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.

+3


source to share


3 answers


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.



+1


source


Internal Server Error. Make sure all of your directives are correct. If you have a .htaccess file , make sure you don't have any typos. Besides that, you can debug your script. You may have changed a setting that is causing an error or conflicts with something else on the server.



0


source


Do you have Mod_Security or php-suhosin installed? This may interfere with the default settings.

0


source







All Articles