PHP Fatal error: Maximum execution time of infinity exceeded!

PHP Fatal error: Maximum execution time of 0 seconds exceeded

Lately, I have been working with some big blog exports from Movable Type and TypePad. I was thankful to notice Mark Jaquith recently patched the WordPress MT importer to allow uploading the import file directly (ftp, scp) and then run the import against the file already on the server.

In my vanilla development Ubuntu 7.04 environment1, 150 of 1500 posts in, on one with a lot of comments it failed with

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/wp/trunk/wp-includes/plugin.php on line 74

Ok, so I updated max_execution_time = 0 , and 150 posts it fails again, this time with

Fatal error: Maximum execution time of 0 seconds exceeded in /var/www/wp/trunk/wp-includes/plugin.php on line 141

Maximum execution time of 0 seconds exceeded?! 0 is supposed to be for unlimited. I have been to infinity and beyond!

Thanks to verysimple.com’s blog I found out that the error is misreported and the real problem is now max_input_time . I don’t know how I would have figured this out if others had not shared it!

Setting this also to zero and the import was successful (though slow). I did not trust that there would not be any duplicates or partial entries, so I cleaned out the content and did it one more time.

  1. libapache2-mod-php5 5.2.1-0ubuntu1.2 []
This entry was posted in WordPress and tagged . Bookmark the permalink.

6 Responses to PHP Fatal error: Maximum execution time of infinity exceeded!

  1. Lloyd says:

    Of course, I would not use/leave those “infinite” values in a production environment.

  2. Lloyd says:

    I looked at bugs.php.net , but am a bit intimidated to submit this as a bug report specifically without testing on PHP trunk, which I am also intimidated to try.

    Possibly related bugs:

    Bug #28572 termination because of max_input_time returns error for max_execution_time
    http://bugs.php.net/bug.php?id=28572

    Bug #39448 Maximum execution time exceeded even if is unlimited
    http://bugs.php.net/bug.php?id=39448

  3. Serban of ghita.ro says:

    i are right. i was able to reproduce this with PHP 5.2.3 (cli) (built: Jun 29 2007 00:24:51)

    with

    max_execution_time = 0
    max_input_time = 30

    i got:

    Fatal error: Maximum execution time of 0 seconds exceeded in /usr/local/apache2/htdocs/test.php on line 73

    i’ve changed max_input_time = 0 and restarted apache, and it worked.

  4. Ian says:

    Thanks! This should fix my problem

    “Fatal error: Maximum execution time of 0 seconds exceeded”… oxymoron? lol

  5. Tian Dan says:

    Thank you very much!
    your blog has solved my problem!

  6. Siddharth says:

    Thanks, the max_input_time had to be set to -1 it worked then

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>