Computing.Net > Forums > Linux > Php max execution

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Php max execution

Reply to Message Icon

Name: Jamie_McCoy
Date: July 1, 2005 at 14:02:13 Pacific
OS: XP Pro 5.1
CPU/Ram: Pentium 4 2.4Ghz
Comment:

Hi, ok i'll make this as simple as possible

i have a website, 40,000 members all squeezed into a flat file database

im now in process of converting that to MYSQL, so ive wrote a simple PHP script out which uses a loop to dump each users details into the table

it works fine, the script is flawless, but after 30secs it stops processing

now obviously this is due to a PHP limit of MAX Execution Time

Noted, and altered to 700 secs, restarted apache, then the server, still no luck

any ideas

roamhosting.net



Sponsored Link
Ads by Google

Response Number 1
Name: anonproxy
Date: July 2, 2005 at 10:09:34 Pacific
Reply:

I would personally perform this in the command line.

You should read the php documentation.

set_time_limit() can be called in-script. It accepts an integer parameter, in seconds, which will add that time onto the php.ini value max_execution_time. Also, you can ini_set('max_execution_time', INTEGER). I think safe mode turns all these off, however.

The server also has its own timeout value (check httpd.conf for Apache). The browser may have its own timeout limit too. (again, I would use the CLI)

So, decide how many operations will be performed in a batch (let's say 250, completely arbitrary). Whatever you do, break the operation down into smaller pieces. Write your script to call set_time_limit() and double the preset value. Note, this could propogate your script forever. I would increment a counter for each record and print that to a file at the beginning and end of each batch. You could even throw in a loop which checks to make sure this value is incrementing.



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Php max execution

PHP displaying blank page when exec www.computing.net/answers/linux/php-displaying-blank-page-when-exec/23066.html

DVD Writing Problems www.computing.net/answers/linux/dvd-writing-problems/26222.html

Apache/PHP Config Problem www.computing.net/answers/linux/apachephp-config-problem/23024.html