LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to implement php with nginx on arch linux (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-implement-php-with-nginx-on-arch-linux-4175443976/)

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: 192.168.1.13, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.19"

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_pass 127.0.0.1:9000;
# 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 127.0.0.1:9000? 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 11:14 PM.