Running a very long script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jamesbrauman
Forum Newbie
Posts: 1
Joined: Tue Aug 26, 2008 7:13 am

Running a very long script

Post by jamesbrauman »

Hello everyone, first post here :)

I am attempting to run a php script that needs to access over 4000 html pages, extract content from these pages, and save the content to my mysql database. I have been able to get the script to run for long periods of time, however after some unknown amount of time the connection between PHP and MYSQL goes strange, and Mysql keeps inserting blank rows instead of rows populated with data, even though I know that the rows I sent to mysql are populated (this is after a couple of hours running.)

Help?
eskio
Forum Commoner
Posts: 66
Joined: Tue Apr 01, 2008 1:00 am

Re: Running a very long script

Post by eskio »

Hi,

I am not sure but try this

set_time_limit(0); at the top of your page.

And under phpmyadmin folder in config.inc.php change the default value of 300 by 0
$cfg['ExecTimeLimit'] = 300; // maximum execution time in seconds (0 for no limit)
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: Running a very long script

Post by Chalks »

4000 pages at one time? I would definitely split that up into batches of 50 or so, no chance I would do that all at once.
Post Reply