You are here:  » Maximum execution time of 30 seconds


Maximum execution time of 30 seconds

Submitted by formmailer on Thu, 2010-06-17 14:37 in

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

Submitted by support on Thu, 2010-06-17 14:46

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.

Submitted by formmailer on Thu, 2010-06-17 20:34

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