Page 1 of 1

set_time_limit alternatives?

Posted: Fri Oct 15, 2004 6:28 am
by mrmille
G'day!

I got a problem with a script that takes sometime to execute. Its a fileuploader. If i try to upload a small file it works fine but a larger file will make the script timeout.

Anyway
I got access to a server running in safemode (its a webhotell) and are now looking for some alternatives to set_time_limit(0);. Unfortenately i cant change the php.inf settings and either increase the default values or turn off safemode.

In asp i can set the timelimit like this
Server.ScriptTimeout = 60*100
This one is only relevant for the script OR function thats executed. Which means that i can use that timeout for a single function.

If there is no way to solve this i'd say that php i useless in filehandling situations :roll:

Please help!

Posted: Fri Oct 15, 2004 6:56 am
by twigletmac
safe mode is kinda the problem here, not PHP, if that was disabled you'd have no issue because you can just use [php_man]set_time_limit()[/php_man]:
PHP Manual wrote:Warning

set_time_limit() has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.
This is an issue with the host of the site, not with PHP itself ;) .

Mac

Posted: Fri Oct 15, 2004 7:18 am
by mrmille
That makes php a bit louse actually

damn
:(

Posted: Fri Oct 15, 2004 7:23 am
by twigletmac
mrmille wrote:That makes php a bit louse actually

damn
:(
No, that makes safe mode lousy. It's a pig to work with often and it's generally best to avoid servers which have it enabled to save yourself a bunch of hassle.

Mac