Support » Plugin: Fast Velocity Minify » error 500 nginx multisite

  • Resolved sanderswp


    Setup is nginx + fastcgi_cache + subdomain-multisite.

    After activation of the fvm plugin non-admin pages get 500 error.

    Nginx error log:

    2018/09/04 12:34:56 [error] 727#727: *207 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Class ‘DOMDocument’ not found in /var/www/
    Stack trace:
    #0 /var/www/ fastvelocity_min_defer_js(‘<script type=’t…’, ‘fvm-header-0′, ‘//…’)
    #1 /var/www/ WP_Hook->apply_filters(‘<script type=’t…’, Array)
    #2 /var/www/ apply_filters(‘script_loader_t…’, ‘<script type=’t…’, ‘fvm-header-0′, ‘//…’)
    #3 /var/www/ WP_Scripts->do_item(‘fvm-header-0’, 0)
    #4 /var/www/ WP_Dependencies->do_items(Array, 0)
    #5 /var/www/ WP_Scripts->do_head_items()
    #6 /var/www/ print_head_scripts()
    #7 /var/www/ wp_print_head_scripts(”)
    #8 /var/www/example” while reading response header from upstream, client:, server:, request: “GET / HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “”

    What to do now?
    P.S. the #8 /var/www/example looks not right, the web folder is

    • This topic was modified 5 months, 2 weeks ago by  sanderswp.
    • This topic was modified 5 months, 2 weeks ago by  sanderswp.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Raul Peixoto


    Hi there!

    Most people is using NGINX with FVM, so the problem is not between FVM and NGINX specifically…

    The error that you see is Fatal error: Class 'DOMDocument' not found in... and what it means is that FVM request a function from PHP DOM that is usually available by default on most servers, but seems to be missing on yours.

    PHP is what processes WordPress and it has multiple extensions which are used by scripts as needed. In this case, the class is not available because your server is missing the xml extension for PHP.

    In other words…whoever installed PHP on your server, forgot to install the xml extension, hence when FVM calls a XML related function, it doesn’t exist and the webserver shows a server error 500 (note it’s a server error).

    Depending on your php version, you simply need to install that extension, although I would suggest installing most of the PHP available extensions for better compatibility with all plugins and themes.

    Perhaps ask your developer/sysadmin or hosting about it?
    Most PHP extensions should be included by default on all servers.

    For ubuntu Linux, these are roughly the default packages for NGINX with PHP-FPM 5.6:

    php5.6-fpm php5.6-bcmath php5.6-common php5.6-curl php5.6-gd php5.6-gmp php5.6-imap php5.6-intl php5.6-json php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-pgsql php5.6-recode php5.6-soap php5.6-tidy php5.6-xml php5.6-xmlrpc php5.6-zip php5.6-opcache php5.6-xsl

    or if let’s say, PHP 7.1:

    php7.1-fpm php7.1-bcmath php7.1-common php7.1-curl php7.1-gd php7.1-gmp php7.1-imap php7.1-intl php7.1-json php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-pgsql php7.1-recode php7.1-soap php7.1-tidy php7.1-xml php7.1-xmlrpc php7.1-zip php7.1-opcache php7.1-xsl

    So now, it just depends on your system, server and systems administrator 🙂

    Thank you for this detailed reply, very helpful. Being the (junior) systems administrator I have to do some work. Knowing FVM is happily running on other nginx multisite systems I know now it must be my fault when it doesn’t.

    Many Thanks, Sander.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.