-   Linux - Newbie (
-   -   unable to implement php with nginx on arch linux (

Laertiades 01-03-2013 09:14 AM

unable to implement php with nginx on arch linux
I have nginx working with arch linux. I am having trouble adding php and fastcgi. I installed the php and php-fpm packages. php-fpm service is on. When I access a file with a php extension, the browser displays the nginx error page and I get the following nginx error log message added:

2013/01/02 22:39:43 [error] 721#0: *27 connect() failed (111: Connection refused) while connecting to upstream, client:, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://", host: ""

the contents of the php file seem to make no difference. I have been unable to locate php error log or create my own. I added the following to /etc/php/php.ini:

error_log = /var/log/php_error.log

and I made the file world writable but nothing goes there. I added the following to /etc/nginx/nginx.conf:

location ~ \.php$ {
root /usr/share/nginx/html;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi.conf;

uncommenting the commented lines changes nothing. Commenting the uncommented lines changes the browser page displayed from error page to file not found page.

Any help would be greatly appreciated. Thanks in advance.

szboardstretcher 01-03-2013 09:27 AM

Firewall settings? Perhaps temporarily disable the firewall and try again. Also, SElinux can be a pain if its enabled.

Laertiades 01-03-2013 09:55 AM

Thank you for your help szboardstretcher. I don't know much about firewall settings and never knowingly did anything to create or modify them. I stopped the service iptables but my problem persisted. I will look into firewall settings further. As far as I can tell SELinux in not enabled.

grim76 01-03-2013 09:59 AM

Are you sure that you have fastcgi configured and listening on Looks like that is where things are falling apart.

Laertiades 01-03-2013 10:27 AM

Grim76- Thank you so much. No, fastcgi was not listening. I had to uncomment a line in the php-fpm.conf. Works now.

All times are GMT -5. The time now is 09:26 PM.