Hi David,
When I run a XML to database import using MagicParser I receive the error:
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/vhosts/..../httpdocs/feed/MagicParser.php on line 2
I added set_time_limit(0);
to the top of my script, it didn't work.
I disabled PHP safe mode and restarted Apache (it's a VPS): no success.
And the strangest part is that I can run larger imports that take over 300 seconds, using a copy the same script.
Do you have any suggestions on fixing this?
Thanks in advance!
//Jasper
Thanks David. You pointed me in the right direction.
I had to change it in the vhost.conf file for the domain (vhost).
But now it's solved.
Thanks!
/Jasper
Hi Jasper,
It's possible that your PHP configuration (php.ini) is setting the time limit without set_time_limit() being allowed to override it - as depending upon how the scripts that you are running are coded; they may be shelling out of PHP and not counting towards the overall time.
Try making sure that
max_execution_time = 0
...in your php.ini - if you're not sure where the file is, when you've logged in to a shell, enter
$locate php.ini
(where $ is your command prompt)
Don't forget to restart Apache afterwards - probably using:
$/etc/init.d/httpd restart
Hope this helps!
All the best,
David.