WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Minify HTML errors (5 posts)

  1. hollywoodgrind
    Member
    Posted 4 years ago #

    I am getting this error with W3 Total Cache 0.8:

    httpd: PHP Fatal error: Maximum execution time of 30 seconds exceeded in wp-content/plugins/w3-total-cache/lib/Minify/Minify/HTML.php on line 119

    The message continues to repeat. For now I've turned off Minify for HTML.

    Why is this error occurring?

  2. Frederick Townes
    Member
    Posted 4 years ago #

    This is not a known issue.

    Can you give me a URL where I can see the HTML being minified? Additionally, you can increase your max' execution time to figure out how much time is actually required.

  3. hollywoodgrind
    Member
    Posted 4 years ago #

    I've isolated the problem to the minify scripts you included in W3TC, as you can see in the error. Here's what I did to fix the problem.

    1. Disabled Minify in W3TC
    2. Installed the WP Minify plugin
    3. All the errors stopped, and I have my site minified

    WP Minify uses the Minify engine as I believe W3TC does as well. I compared line 119 from the HTML.php file from W3TC to the Minify engine file, and found they are identical, however the HTML.php from both the Minify engine and W3TC differed from the code in WP Minify.

    The Minify Engine and W3TC HMTL.php file contains (lines 115-119):

    // replace TEXTAREAs with placeholders
            $this->_html = preg_replace_callback(
                '/\\s*(<textarea\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
                ,array($this, '_removeTextareaCB')
                ,$this->_html);

    The WP Minify HTML.php contains (lines 89-93):

    // replace TEXTAREAs with placeholders
            $html = preg_replace_callback(
                '/\\s*(<textarea\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
                ,array(self::$className, '_removeTaCB')
                , $html);

    The only disadvantage to using WP Minify is that it serves the compressed .css and .js files from the hard disk, rather than memcached, but Apache compresses them with gzip as well, so there's no resource use impact that is noticeable.

  4. hollywoodgrind
    Member
    Posted 4 years ago #

    I had the warning after upgrading to 2.8.5 below:

    httpd: PHP Warning: gzinflate() [<a href='function.gzinflate'>function.gzinflate</a>]: data error in /var/www/blog/wp-includes/http.php on line 1787

    The gzinflate indicates a compression problem with a core WordPress file, or at least line 1787 of that file, which I had to comment out so it would stop filling my log file with errors.

    So I started to suspect that perhaps Minify in W3TC was not the problem. I went back and enable Minify for HTML, JavaScript, and CSS. I then disabled:

    HTTP compression (gzip / deflate)
    and
    HTTP compression for MSIE6

    With those two compression settings enabled I kept getting this message in my error log:
    PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/blog/wp-content/plugins/w3-total-cache/lib/Minify/Minify/HTML.php on line 119

    With the compression settings disabled on the Minify tab the errors disappeared.

  5. Frederick Townes
    Member
    Posted 4 years ago #

    The only disadvantage to using WP Minify is that it serves the compressed .css and .js files from the hard disk, rather than memcached, but Apache compresses them with gzip as well, so there's no resource use impact that is noticeable.

    Unfortunately there's more to think about. W3TC integrates minify with all of the rest of it's functionality (including memory caching as you've pointed out), even more importantly, header management and CDN functionality are complimented by the rest of the suite.

    PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/blog/wp-content/plugins/w3-total-cache/lib/Minify/Minify/HTML.php on line 119

    This is not a known issue although I've seen this happen once before; the problem is that this is circumstantial. It varies site/server to site/server coupled with the fact that W3TC is using a later release of minify engine than WP minify does. And I have made some changes to minify to deal with a couple bugs there, until they're modified in a later release.

Topic Closed

This topic has been closed to new replies.

About this Topic