Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Search this Thread
Old 01-03-2013, 10:14 AM   #1
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 59

Rep: Reputation: Disabled
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.
Old 01-03-2013, 10:27 AM   #2
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,369
Blog Entries: 1

Rep: Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088
Firewall settings? Perhaps temporarily disable the firewall and try again. Also, SElinux can be a pain if its enabled.
Old 01-03-2013, 10:55 AM   #3
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 59

Original Poster
Rep: Reputation: Disabled
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.
Old 01-03-2013, 10:59 AM   #4
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 281

Rep: Reputation: 47
Are you sure that you have fastcgi configured and listening on Looks like that is where things are falling apart.
1 members found this post helpful.
Old 01-03-2013, 11:27 AM   #5
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 59

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


archlinux, fastcgi, nginx, php5

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
nginx + php-fpm and nginx modules fantasygoat Linux - Server 0 06-09-2011 01:21 PM
Nginx experts help me-problem when using Nginx php-fpm !!! HuMan-BiEnG Linux - Server 2 04-17-2011 03:30 PM
NGINX with PHP-FPM vis NGINX with Spawn-FCGI WhisperiN Linux - Server 1 03-15-2011 07:39 PM
LXer: Installing Nginx With PHP 5.3 And PHP-FPM On Ubuntu Lucid Lynx (10.04) LXer Syndicated Linux News 0 06-15-2010 12:42 AM
LXer: How to install Nginx to run Drupal with boost, on an Arch Linux server LXer Syndicated Linux News 0 04-16-2010 03:00 PM

All times are GMT -5. The time now is 02:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration