LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 01-03-2013, 09:14 AM   #1
Laertiades
Member
 
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 57

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: 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.
 
Old 01-03-2013, 09:27 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux
Posts: 2,831
Blog Entries: 1

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

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, 09:59 AM   #4
grim76
Member
 
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 266

Rep: Reputation: 43
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.
 
1 members found this post helpful.
Old 01-03-2013, 10:27 AM   #5
Laertiades
Member
 
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 57

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.
 
  


Reply

Tags
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 12:21 PM
Nginx experts help me-problem when using Nginx php-fpm !!! HuMan-BiEnG Linux - Server 2 04-17-2011 02:30 PM
NGINX with PHP-FPM vis NGINX with Spawn-FCGI WhisperiN Linux - Server 1 03-15-2011 06:39 PM
LXer: Installing Nginx With PHP 5.3 And PHP-FPM On Ubuntu Lucid Lynx (10.04) LXer Syndicated Linux News 0 06-14-2010 11:42 PM
LXer: How to install Nginx to run Drupal with boost, on an Arch Linux server LXer Syndicated Linux News 0 04-16-2010 02:00 PM


All times are GMT -5. The time now is 03:01 AM.

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