New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
PHP Timeout in nginx
I have troubles configuring website using nginx. Server is randomly timed out even in simple php script. CPU is 95%+ in idle state. Cloudlinux LVE limit also set to unlimited, I maxed the cpu & other LVE limit. Anyone experience this before?
Error log: The timeout specified has expired: AH01075: Error dispatching request to : (polling).

Comments
So? Just configure PHP timeout, either via php.ini or php-fpm pool.d file. Did you asked cgpt?
Still not working. Added timeout for 300s too. Its simple crud app that run fast even in low spec laptop. Dunno why its timed out in genoa vds.
put echo on every few lines & inside for / while / other kind of loop
By any chance, have you checked if there's possibly a script or process running in the background consuming resources? Also, it might be good to look into Nginx configuration for any timeout settings or resource limits that might be causing this.
Hey, I am no expert, but, I faced a similar issue only a few days ago. This is what got it fixed for me:-
I added this under the
location ~ \.php$block on my nginx configuration file, usually in/etc/nginx/sites-availableYou could also try adding this in your configuration file at the end:-
The value 120 can be changed according to your wish, but, not sure, if higher values are recommended for production.
Have you tried to check the PHP logs why it timeouts?
Random guess: this app loads something external and from time to time it fails due to misconfigured IPv6.
CRUD app, database slow? I was having a trouble once with my DB response as the DB server was located on different server and was having some network issues.
localhostmight resolve to ::1 while the database listens to 127.0.0.1. If PHP pursues the database overlocalhostit won't be happy.By the error code, if I am not mistaken, refes to apache error.
Are you nginx as reverse proxy?
no heavy background process running. cpu usage is under 10%.> @noob404 said:
tried this but still randomly timed-out.> @JabJab said:
sadly there's no error log in php
DB is in localhost> @itachikonoha said:
yes, it's nginx as reverse proxy. tried nginx directly as a server too but still not working.
I'm trying to move to other server that not using cloudlinux now.
@faleddo If i were you, then I would have started with all the
file_get_contents()and start debug from there.I hope you are restarting Nginx and PHP after the edits. If you are, pardon me then
Checkout
/var/log/nginxIt should output some misconfiguration.