Apache throws 500 after 30 seconds
I am running Apache2 and PHP5 on a dedicated VPS.
I have a script that needs to end anywhere from 20-50 seconds. It works fine, but if it takes more than 30 seconds due to the selected lines, it instantly kills the script and says:
"Service unavailable - the service is temporarily unavailable. Please try again later.
I have max_execution_time=60
, max_input_time=60
and memory_limit=256M
in my php.ini.
In apache2.conf I have Timeout=300
.
In the script itself, I also use set_time_limit(0);
ignore_user_abort(true);
ini_set('max_execution_time', 0);
ini_set('memory_limit', '512M');
Regardless of what I change, the script dies anytime it takes 30.00 seconds to load and nothing appears in any of my logs.
Any suggestions on what other settings to try?
This script is for internal use only and will eventually run from the command line, but I prefer to debug / test from the browser.
source to share
The error you indicated: "Service unavailable - service is temporarily unavailable. Please try again later." doesn't sound like a 500 answer, it sounds like 503. Are you sure you are getting 500? the reasons for 503 will be different.
source to share