Checking out the project and the functionalities , I did recognize that file_get_contents
for internal files doesn't work at all. It always give me the same error :
file_get_contents 504 gateway timeout
Can you help me to find out how to fix it?
To resolve this: Modify the idle timeout for your load balancer so that the HTTP request completes within the idle timeout period. Modify your application to respond to the HTTP request faster. Make sure that the application doesn't take longer to respond than the configured idle timeout.
The 504 Gateway error is usually temporary, and different reasons may cause it. Most often than not, the problem is due to a client-end issue like Internet connection troubles. However, the hitch may be due to server-to-server network connectivity issues or a server being down.
For Nginx server
Check that you are not running into worker depletion on the PHP side of things, I had face this issue too on my lab server setup which was configured to save RAM. Basically I forgot that you are 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 available 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With