Nginx and PHP-cgi - can't file_get_contents of any website on the server

我是研究僧i 提交于 2019-12-02 00:12:45

Check that your not running into worker depletion on the PHP side of things, this was the issue on my lab server setup which was configured to save RAM.

Basically I forgot that your using a single worker to process the main page been displayed to the end-user, then the get_file_contents() function is basically generating a separate HTTP request to the same web server, effectively requiring 2 workers for a single page load.

As the first page was using the last worker there was none avaliable for the get_file_contents function, therefore Nginx eventually replied with a 504 on the first page because there was no reply on the reverse proxy request.

Check if allow_url_fopen is set to true in your php.ini.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!