Phpfastcgi problem, deadlock, timeout my server environment is nginx, using fast-cgi method to parse php. $ Open_url & nbsp; = & nbsp; 'http: // 127.0.0.1: 82/test. php'; $ img_save_url & php fastcgi problem, deadlock, timeout
My server environment is nginx and uses the fast-cgi method to parse php.
$ Open_url = 'http: // 127.0.0.1: 82/test. php ';
$ Img_save_url = file_get_contents ($ open_url );
If the value is test.html, the local aspx page can also obtain the result. However, php reports the 504 gateway timeout error.
What causes this problem? Is cgi deadlocked?
The method used to start is: RunHiddenConsole.exe c: \ php \ php-cgi.exe-B 127.0.0.1: 9000-c: \ php. ini
------ Solution --------------------
In nginx and php-cgi modes, why do we have to get stuck in windows without using linux ......
------ Solution --------------------
Even a local virtual machine can be used.
------ Solution --------------------
$ Img_save_url = file_get_contents ($ open_url );
Allow_url_fopen = On
I wonder if you have set
------ Solution --------------------
Default llow_url_fopen = Off
You will never
Test. php
$open_url = 'http://127.0.0.1:82/test.php';
Right?
------ Solution --------------------
Can test.html directly run php statements?
Literacy
------ Solution --------------------
Paste your nginx. ini configuration file and run the fastcgi command in your command.
------ Solution --------------------
Reference:
Reference: can test.html directly run php statements?
Literacy
Do you understand?
I mean
$ Open_url = 'http: // 127.0.0.1: 82/test.html ';
$ Img_save_url = file_get_contents ($ open_url );
$ Img_save_url can obtain the returned value, indicating that it can be transferred to the website ......
Sorry
Understanding error
You can start service nginx start under the command
Or view the nginx error log.
Generally, this obvious error can be seen.
------ Solution --------------------
Reference:
The problem is solved. when two php-cgi.exe processes, one port is 9000 and the other port is 9001, no deadlock will occur. The two sub-websites use different processing methods:
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_pass 127.0.0.1: 9001;
The cause of the problem should be a deadlock in the process.
Do you need to configure multiple projects in the nginx. conf file for running?