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.