Reputation: 25369
I'm working on a one-time PHP (5.2.6) script that migrates several million of MySQL (5.0.45) database rows to another format in another table while keeping (a lot) of relevant data in memory for incremental calculations. The data is calculated incrementally. (in chunks of about 1000 lines)
The script stops unexpectedly in random points without an error message. My question is- how can I find out whats the reason for the script stopping. (memory outage? timeout by MySQL etc...)
I have set_time_limit (0); so its not PHP timeout.
Upvotes: 0
Views: 357
Reputation: 125594
see the log file, probably is memory
you need to add more memory
in php.ini to memory_limit
parameter
Upvotes: 2
Reputation: 25369
Thanks everyone for the help (I voted for the relevant answers). The issue was memory and setting ini_set('memory_limit', '200M'); solved it (it is a one time script)
Upvotes: 0
Reputation: 63586
Have you tried running the PHP from the command line rather than via a web browser? Maybe the server has something which causes it to fall over once it reaches a certain memory usage?
In general bulk operations shouldn't be done via a web server, it's liable to make them fail part way through.
Upvotes: 1
Reputation: 70001
error_reporting(E_ALL | E_STRICT);
Upvotes: 1
Reputation: 13972
You could try turning the error reporting level (in php.ini) up really high, so it complains about more things.
My first guess would have been that you hit your execution time limit or memory limit and the script was terminated, but you covered that.
Upvotes: 1