nginx running, php fast-cgi running, but .php not working ??
I really need your help. I just installed Nginx and php fast-cgi. the both are running. With ps aux | grep nginx and ps aux | grep cgi, I will be able to check if it's running. When I test to display a simple .html file in my wen repository, I don't have any problem but when I try to display some .php extension, it's not working (with simple .php file with phpinfo()).
The error I have in my log is:
connect() failed (110: Connection timed out) while connecting to upstream
I don't know where I missed something.
Regards,
Julien
6 Replies
server {
listen 178.79.137.216:80;
server_name
access_log /home/webdorado/logs/access.log;
error_log /home/webdorado/logs/error.log;
location / {
root /home/webdorado/public_html/wordpress;
index index.html index.htm;
}
location ~ .php$ {
if (!-f $request_filename) {
return 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgiparam SCRIPTFILENAME /home/webdorado/publichtml/wordpress$fastcgiscript_name;
include /etc/nginx/fastcgi_params;
}
deny access to .htaccess files, if Apache's document root
concurs with nginx's one
#
location ~ /.ht {
deny all;
}
}
and for the configuration of fat-cgi, I followed the instruction describes on this page
!/bin/sh
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 6 -u www-data -f /usr/bin/php5-cgi
What happens when you do … ?
/etc/init.d/php-fastcgi stop
/etc/init.d/php-fastcgi start
I replaced fastcgipass 127.0.0.1:9000; by fastcgipass unix:/tmp/fcgi.sock; and modify /usr/bin/php-fastcgi file. In Linode library, it's:
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 6 -u www-data -f /usr/bin/php5-cgi
I replaced too by:
/usr/bin/spawn-fcgi -s /tmp/fcgi.sock -C 6 -u www-data -g www-data -f /usr/bin/php5-cgi
I don't know I have to use a socket???. I will ask to Linode support. Very strange. If you have an idea, you're welcome
Thanks !
Julien