LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-12-2011, 05:10 AM   #1
Greendrake
LQ Newbie
 
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
nginx/php/spawn-fcgi: no response when script requests same server


First of all, I have a perfectly working installation of nginx / PHP / fastcgi on the latest stable Debian distribution. No problems at all, apart from this one:

When a PHP script (script A) is written to request a PHP script on the same web server (script B), nginx takes several minutes to respond and finally the connection times out. And it happens only when invoking script A through nginx. Calling it from command line works fine — I get a normal output of script B.

Literally, the test case is as simple as:

Script A:
PHP Code:
echo file_get_contents("http://myhost/B.php") . "\n"
Script B:
PHP Code:
echo "I am Script B\n"
I suppose the root of the problem may be some obstacle occurring when php5-cgi ends up invoking itself. And this is what happens when script A is called through nginx. But I have no ideas yet how to address the problem.

One of my PHP applications checks itself during installation, that's why I need to request a PHP script from a PHP script on the same server.
 
Old 05-10-2011, 01:46 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
I'd say it's something with the firewall... if active.
Idea:
Command line goes through loopback which normaly is allowed by every firewall
nginx goes with the ip the http server is listening on. And this could be blocked by the firewall.

Or you just have a simple dns issue, which I somehow doubt.
Does the server give out any further error message? Maybe you can use gethostbyname to see if php does dns right.
 
  


Reply



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 experts help me-problem when using Nginx php-fpm !!! HuMan-BiEnG Linux - Server 2 04-17-2011 02:30 PM
Apache server simultaneous requests time out while PHP script is running ilnli Linux - Server 2 04-02-2011 09:00 AM
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
Nginx + php-fpm Slow Response When Busy godius Linux - Software 0 07-02-2009 02:25 PM

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

All times are GMT -5. The time now is 07:17 AM.

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