Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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.

![]() |
![]() |
![]() |

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