LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-24-2014, 04:59 AM   #1
pramono
Member
 
Registered: Feb 2013
Location: Localhost
Distribution: Slackware
Posts: 32

Rep: Reputation: Disabled
nginx can't access php script.


hello guys. i have problem with nginx and php5-fpm.sock. the php5-fpm no such in /var/run which the default directory of php5-fpm.sock. it causes nginx can not access the php script. i try some of them method, change configuration in /etc/php5/fpm/pool.d/www.conf.

Code:
listen = /var/run/php5-fpm.sock
i change to

Code:
listen = 127.0.0.1:9000
but i get some error.

Code:
2014/09/24 16:46:10 [error] 1040#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
i use ubuntu 14.04 operating sytem.
thanks before.
 
Old 09-24-2014, 05:42 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
duplicate of http://www.linuxquestions.org/questi...pt-4175519900/
 
Old 09-24-2014, 07:05 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@OP
Quote:
2014/09/24 16:46:10 [error] 1040#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
From the log above, looks like php-fpm is not running, as nginx gets a "Connection refused"
Stat php-fpm and try again

Regards
 
Old 09-24-2014, 08:02 AM   #4
pramono
Member
 
Registered: Feb 2013
Location: Localhost
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
@OP
From the log above, looks like php-fpm is not running, as nginx gets a "Connection refused"
Stat php-fpm and try again

Regards
thanks for reply, but i've tried it. but still doesn't work. and displays the same log errors
 
Old 09-24-2014, 08:07 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
did you check that port (if it was really opened?)
 
Old 09-24-2014, 07:12 PM   #6
pramono
Member
 
Registered: Feb 2013
Location: Localhost
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
did you check that port (if it was really opened?)
@pan64 yes. the port is open

Code:
root      1094     1  0 07:08 ?        00:00:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)                    
www-data  1096  1094  0 07:08 ?        00:00:00 php-fpm: pool www-data                                                  
www-data  1097  1094  0 07:08 ?        00:00:00 php-fpm: pool www-data                                                  
root      2967  2954  0 07:11 pts/2    00:00:00 grep --color=auto php-fpm
 
Old 09-25-2014, 12:09 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
no that is not enough. you may try netstat for example
 
Old 09-25-2014, 02:53 AM   #8
pramono
Member
 
Registered: Feb 2013
Location: Localhost
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
no that is not enough. you may try netstat for example
ohh sorry. this result for netstat.

http://pastebin.com/9WJQQvGJ

and i don't look php5-fpm proccess.
 
Old 09-25-2014, 03:36 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Better try this:
Code:
netstat -tanpl|grep 9000
 
Old 09-25-2014, 03:37 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
try netstat -a | grep 9000
 
Old 09-25-2014, 03:48 AM   #11
pramono
Member
 
Registered: Feb 2013
Location: Localhost
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Better try this:
Code:
netstat -tanpl|grep 9000
i've try but no display.
 
Old 09-25-2014, 03:51 AM   #12
pramono
Member
 
Registered: Feb 2013
Location: Localhost
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
try netstat -a | grep 9000
and no display for port 9000. what do you think are my problem ? what php5-fpm does any problem ? thankyou for help. but this problem has not solved.
 
Old 09-25-2014, 03:54 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
yes, that means the port is not opened. Would be nice to check the config file: /etc/php5/fpm/php-fpm.conf
can you post it?
 
Old 09-25-2014, 04:06 AM   #14
pramono
Member
 
Registered: Feb 2013
Location: Localhost
Distribution: Slackware
Posts: 32

Original Poster
Rep: Reputation: Disabled
[SOLVED]

seems the spawn-fcgi not installed in my ubuntu 14-04 or I might accidentally delete it. and i try install spawn-fcgi again

Code:
sudo apt-get install spawn-fcgi
and i change permission to nginx can conect to fast_cgi.

Code:
spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/bin/php-cgi -C 5 -U pramono
"pramono" is my user root.

this result for netstat -a | grep 9000

Code:
tcp        0      0 localhost:9000          *:*                     LISTEN


big thanks for help..
Attached Thumbnails
Click image for larger version

Name:	phpinfo.png
Views:	40
Size:	154.8 KB
ID:	16505  
 
Old 09-25-2014, 04:15 AM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
glad to help you. If you really want to say thanks just press yes....
 
1 members found this post helpful.
  


Reply

Tags
nginx



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/php/spawn-fcgi: no response when script requests same server Greendrake Linux - Server 1 05-10-2011 01:46 AM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration