![]() |
Issues on php.ini
Hello to everyone --
I ran a PHP program the other day and got the "30" second server timeout error. I looked about the internet for a solution, and found an advisory post where the author recommended changing the php.ini settings to a timeout to 120 seconds and upping the script memory from 8K to 256K. I did this and the program ran as intended. So, my question is, are there any repercussions for changing these settings? Or, is it just a willy-nilly, harmless thing like picking a shirt color? Thanks, Dave |
In most circumstances, in particular websites, you shouldn't want a script to be running for 30 seconds or longer. If a page took that long to load, chances are your visitors would have gone elsewhere way before 30 seconds elapsed but it's a good point to cut off further execution to prevent things running for a long time (for any number of reasons). The official reasoning (from the PHP Manual) would be that it "helps prevent poorly written scripts from tying up the server".
Rather than changing the php.ini settings, which will affect every PHP file, you can change the values just for the currently running script (unless running under 'safe mode') by using ini_set() (for max_execution_time and memory_limit). |
You can also use the set_time_limit() function.
|
Thanks for the information
Salathe and Jim --
Thanks for your information. I'll switch to using the "extended server time" option within programs and change back the php.ini settings to their defaults. See you next time, Dave |
You dont want every script on your server to be able to run more than 30 seconds. In most cases it means something is wrong, in others it means a resource is taking too long. One way or another, it could easily get really taxing on your server, especially if someone plots an attack using it. Use ini_set() to set the particular scripts that need to run that long.
|
Thanks!^^
Actually, this is a -- don't know how to explain this -- sort of a desktop application (written in PHP) that I'm working on...My "localhost" server was giving me the timeout error...So, this is not a web app just yet. Dave |
;-)
Quote:
so indirectly its an web app ;-) |
| All times are GMT. The time now is 08:23 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0