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 []

Comments (4)

  1. Lloyd wrote::

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

    Wednesday, May 23, 2007 at 9:43 pm #
  2. Lloyd wrote::

    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

    Thursday, May 24, 2007 at 4:27 pm #
  3. Serban of ghita.ro wrote::

    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.

    Monday, November 5, 2007 at 8:44 am #
  4. Ian wrote::

    Thanks! This should fix my problem

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

    Sunday, March 30, 2008 at 5:45 am #