These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Increase time for file to run on the new forum.
Hello,
I have a .php-file that I run four times a day with a cron job. The .php-file goes thru multiple pages searching for a certain text. And it needs a lot of time to get it's job done.
When I run the script I get a "500 Internal Server Error".
Where can I increase the maximum time for the script to get run? I think it hits the roof for taking to long time and then I get the "500 Internal Server Error".
/Fredrik-s
Howdy,
You may want to take a peek at $HOME/etc/php.ini, and make sure the "max_execution_time" is set high enough for your script to run.
-Eric
Fredrik-s,
It should also technically be possible to this on a script by script basis:
ini_set('max_execution_time',60); # set execution to 60 seconds
-Peter
Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
I still get 500 Internal Server Error.
I have changed the following in $HOME/etc/php.ini:
max_execution_time = 900 ; Original 60 Maximum execution time of each script, in seconds max_input_time = 900 ; Original 60 Maximum amount of time each script may spend parsing request data ;max_input_nesting_level = 64 ; Maximum input variable nesting level memory_limit = 700M ; Original 128M Maximum amount of memory a script may consume (128MB)
Any other clue?
I found the trick.
It was the following line in the path way: Webmin > Servers > Apache Webserver > "Pick your Virtual Server, and click Virtual Server infront" > "Click Change Directives" > "Find the following line and increase":
IPCCommTimeout
Is original set to 31 (which means 31 seconds) increase this.
Thank you for the trick. Saved my life !
This IPCCommTimeout parameter can be accessed and modified from Virtualmin :
virtualim > my_server > Server Configuration > Website Options > Maximum PHP script run time
You Saved me too! thanks for valuable tips
This virtualim > my_server > Server Configuration > Website Options > Maximum PHP script run time helped me in overcome of php max execution time.