set_time_limit don't work

Hi E's, I put in my code the function: set_time_limit(0), and my server gives a error after 30 seconds after start the script.
I try change the value (0) for a big number in seconds like (20000), and it's the same thing!
What I have to do in my server for time with NO LIMIT.
I have to change php.ini? where?
I have to write something in httaccess?

Regards, JC
LVL 3
Pedro ChagasWebmasterAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jimhapConnect With a Mentor Commented:
Safe mode may be on in your server, otherwise including set_time_limit(); should work.

If you have access to your php.ini file, find this:
max_execution_time = 30

And change it to 0 or a big number (suggestion: 0, since this means forever).

If that line doesn't exist, add that and change it to the proper number.
0
 
ycTINCommented:

This function 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.
0
 
markh789Connect With a Mentor Commented:
If your safe mode is on functions are disabled, see the full list here: http://php.net/manual/en/features.safe-mode.functions.php

It reads:
set_time_limit() - Has no effect when PHP is running in safe mode.

Read this: http://au.php.net/set_time_limit
From php.net:
Warning
This function 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.

You can try setting in PHP.INI find max_execution_time, set it to 0 for inifity or set it to your own number.
0
 
Pedro ChagasWebmasterAuthor Commented:
hi e's, if i tell to administrator of my server to change for 'no safe mode', what is the diferences between safe mode or no safe mode.
regards, jc
0
 
markh789Connect With a Mentor Commented:
Safe mode disables functions basically, as an attempt to try and secure the server from attacks through PHP code.

See this website to see what safe mode can do:
http://www.php.net/manual/en/features.safe-mode.php
0
All Courses

From novice to tech pro — start learning today.