Status
Not open for further replies.

MediaStar

Active Member
2,664
2010
446
235
Hye guys, im installing Nginx on centos 64Bit and its working fine. Im also install epel
Code:
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
and php
Code:
yum install php-pear-Net-Socket php-pear php-common php-gd php-devel php php-mbstring php-pear-Mail php-cli php-imap php-snmp php-pdo php-xml php-pear-Auth-SASL php-ldap php-pear-Net-SMTP php-mysql

The problem now is when i upload php file on the server and open it, the page .php is not opening but downloading the index.php file. Did i something wrong with nginx.conf or something here?
 
10 comments
Nginx is used to handle static files.
If you want to run .php files, you have to install fastcgi or something like that
 
Yum install php-fpm, then edit out the nginx.conf file to include the php locations and fastcgi params. You might try centminmod for an automatic script install.
 
# Pass PHP scripts on to PHP-FPM
location ~* \.php$ {
try_files $uri /index.php;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
You'd better post your current nginx.conf and the error you get.
 
Status
Not open for further replies.
Back
Top