502 Nginx Issue - Website not showing unless logged in to WordPress

June 25, 2017 248 views
Nginx WordPress DigitalOcean Security Ubuntu 16.04

I have recently added a 2nd domain to a single Ubuntu 16.04 server and created the necessary files for use with Nginx. This allows Nginx to point to both directory paths for the corresponding domains.

I currently have http://whatjackhasmade.co.uk and https://noface.co.uk.

https://noface.co.uk is unaccessible until I go to https://noface.co.uk/wp-admin and login to my account.

Here is the following sites-available file for noface.co.uk, the sites-enabled is a symlink to this file.

# Default server configuration
#
server {
        listen 80 default_server;
        listen [::]:80 default_server;
        server_name noface.co.uk www.noface.co.uk;
        return 301 https://$server_name$request_uri;
}

server {

        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        include snippets/ssl-noface.co.uk.conf;
        include snippets/ssl-params.conf;

        root /var/www/noface.co.uk/html/wordpress;

        index index.php index.html index.htm index.nginx-debian.html;

        server_name noface.co.uk www.noface.co.uk;

        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;

                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }

        location ~ /.well-known {
                allow all;
        }
}

The issue has only recently occured since I have enabled https:// with an SSL certificate. The https:// works but only when accessing wp/admin. Any help would be greatly appreciated.

5 comments
  • Something you might have overseen, did you check in the wordpress settings at general? There you can edit the site link (http/https).

  • I had a look at the general settings, and the site link did need updating. However, Nginx still returns a 302 error, or my website returns a 500 HTTP Error.

  • Check the error logs and see what you can find there. If you don't know what it says, post it here please.
    Maybe try to use try_files $uri $uri/ /index.php?$args; inside location /

  • Stack trace:
    #0 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(98): AMP_DOM_Utils::get_dom_from_content('<p><a href="htt...')
    #1 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(85): AMP_Content_Sanitizer::sanitize('<p><a href="htt...', Array, Array)
    #2 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(46): AMP_Content->sanitize('<p><a href="htt...')
    #3 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(22): AMP_Content->transform()
    #4 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-post-template.php(242): AMP_Content->__construct('<a href="http:/...', Array, Array, Array)
    #5 /var" while reading response header from upstream, client: 66.249.64.222, server: whatjackhasmade.co.uk, request: "GET /vintage-ensembles-vintage-clothing-store/amp/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.whatjackhasmade.co.uk"
    2017/06/25 14:44:13 [error] 32010#32010: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/Config.php on line 117
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.noface.co.uk"
    2017/06/25 14:44:45 [error] 32010#32010: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php on line 675
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.noface.co.uk"
    2017/06/25 14:45:55 [error] 32010#32010: *11 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/wp-db.php on line 1300
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/plugin.php on line 449" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "http://m.facebook.com/"
    2017/06/25 14:49:42 [error] 32010#32010: *33 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 64.41.200.101, server: noface.co.uk, request: "GET / HTTP/1.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 14:49:47 [error] 32010#32010: *39 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/Config.php on line 117
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 80.56.66.203, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://www.digitalocean.com/community/questions/502-nginx-issue-website-not-showing-unless-logged-in-to-wordpress"
    2017/06/25 14:50:47 [crit] 32010#32010: *159 SSL_do_handshake() failed (SSL: error:14094085:SSL routines:ssl3_read_bytes:ccs received early) while SSL handshaking, client: 64.41.200.101, server: 0.0.0.0:443
    2017/06/25 14:50:48 [crit] 32010#32010: *160 SSL_do_handshake() failed (SSL: error:14094085:SSL routines:ssl3_read_bytes:ccs received early) while SSL handshaking, client: 64.41.200.101, server: 0.0.0.0:443
    2017/06/25 15:09:47 [error] 32010#32010: *249 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/wp-db.php on line 1300
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/plugin.php on line 449" while reading response header from upstream, client: 148.251.15.150, server: noface.co.uk, request: "GET /robots.txt HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 15:15:47 [error] 32010#32010: *254 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php on line 675
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 186.151.96.200, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 15:16:18 [error] 32010#32010: *254 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/option.php on line 1103
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 186.151.96.200, server: noface.co.uk, request: "GET /admin HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 15:16:29 [error] 32010#32010: *268 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php on line 36
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677" while reading response header from upstream, client: 186.151.96.200, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 16:00:21 [error] 32010#32010: *336 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/pluggable.php on line 2069
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://l.facebook.com/"
    2017/06/25 16:03:48 [error] 355#355: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/pluggable.php on line 2018
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://l.facebook.com/"
    
  • @CrypticDesigns I've posted the log; I apologise in advance as I am no expert when it comes to debugging the Nginx log.

    I've also updated the try_files, and the problem still exists. :/

2 Answers

Hi @jacknoface

I don't see any error, when going to the site - only a blank page. So you need to check the error log for further details. Try running this command to get the last 30 lines:

tail -30 /var/log/nginx/error.log

And like @CrypticDesigns says, the try_files isn't correct for WordPress. Should be:

try_files $uri $uri/ /index.php?$args;
  • Stack trace:
    #0 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(98): AMP_DOM_Utils::get_dom_from_content('<p><a href="htt...')
    #1 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(85): AMP_Content_Sanitizer::sanitize('<p><a href="htt...', Array, Array)
    #2 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(46): AMP_Content->sanitize('<p><a href="htt...')
    #3 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(22): AMP_Content->transform()
    #4 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-post-template.php(242): AMP_Content->__construct('<a href="http:/...', Array, Array, Array)
    #5 /var" while reading response header from upstream, client: 66.249.64.222, server: whatjackhasmade.co.uk, request: "GET /vintage-ensembles-vintage-clothing-store/amp/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.whatjackhasmade.co.uk"
    2017/06/25 14:44:13 [error] 32010#32010: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/Config.php on line 117
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.noface.co.uk"
    2017/06/25 14:44:45 [error] 32010#32010: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php on line 675
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.noface.co.uk"
    2017/06/25 14:45:55 [error] 32010#32010: *11 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/wp-db.php on line 1300
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/plugin.php on line 449" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "http://m.facebook.com/"
    2017/06/25 14:49:42 [error] 32010#32010: *33 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 64.41.200.101, server: noface.co.uk, request: "GET / HTTP/1.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 14:49:47 [error] 32010#32010: *39 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/Config.php on line 117
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 80.56.66.203, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://www.digitalocean.com/community/questions/502-nginx-issue-website-not-showing-unless-logged-in-to-wordpress"
    2017/06/25 14:50:47 [crit] 32010#32010: *159 SSL_do_handshake() failed (SSL: error:14094085:SSL routines:ssl3_read_bytes:ccs received early) while SSL handshaking, client: 64.41.200.101, server: 0.0.0.0:443
    2017/06/25 14:50:48 [crit] 32010#32010: *160 SSL_do_handshake() failed (SSL: error:14094085:SSL routines:ssl3_read_bytes:ccs received early) while SSL handshaking, client: 64.41.200.101, server: 0.0.0.0:443
    2017/06/25 15:09:47 [error] 32010#32010: *249 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/wp-db.php on line 1300
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/plugin.php on line 449" while reading response header from upstream, client: 148.251.15.150, server: noface.co.uk, request: "GET /robots.txt HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 15:15:47 [error] 32010#32010: *254 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php on line 675
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 186.151.96.200, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 15:16:18 [error] 32010#32010: *254 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/option.php on line 1103
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 186.151.96.200, server: noface.co.uk, request: "GET /admin HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 15:16:29 [error] 32010#32010: *268 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php on line 36
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677" while reading response header from upstream, client: 186.151.96.200, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
    2017/06/25 16:00:21 [error] 32010#32010: *336 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/pluggable.php on line 2069
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://l.facebook.com/"
    2017/06/25 16:03:48 [error] 355#355: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/pluggable.php on line 2018
    PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://l.facebook.com/"
    
    • @jacknoface

      So there you have it. PHP is currently set to have a memory limit at 128MB of RAM, but the page is using more than that.

      Either you need to lower the amount of RAM - that could be done with fewer plugins and maybe a different theme.

      Or you can edit the file /etc/php/7.0/fpm/php.ini and change the parameter called memory_limit from 128M to something higher like 256M.

      EDIT: Forgot, remember to restart PHP sudo service php7.0-fpm restart

      • Thanks, Hansen!

        I've edited the file so that the memory_limit is now 512M and have updated the server so that it has 1GB accessible to it now.

        ; http://php.net/memory-limit
        memory_limit = 512M
        

        However, I am still getting issues related to the amount of available memory. Maybe, I'm editing the wrong value?

        2017/06/25 15:16:29 [error] 32010#32010: *268 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php on line 36
        PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677" while reading response header from upstream, client: 186.151.96.200, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
        2017/06/25 16:00:21 [error] 32010#32010: *336 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/pluggable.php on line 2069
        PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://l.facebook.com/"
        2017/06/25 16:03:48 [error] 355#355: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/pluggable.php on line 2018
        PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://l.facebook.com/"
        2017/06/25 16:08:54 [error] 389#389: *10 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php on line 36
        PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk", referrer: "https://l.facebook.com/"
        2017/06/25 16:11:58 [error] 389#389: *18 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/utils/class-amp-dom-utils.php:7
        Stack trace:
        #0 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(98): AMP_DOM_Utils::get_dom_from_content('<p><a href="htt...')
        #1 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(85): AMP_Content_Sanitizer::sanitize('<p><a href="htt...', Array, Array)
        #2 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(46): AMP_Content->sanitize('<p><a href="htt...')
        #3 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-content.php(22): AMP_Content->transform()
        #4 /var/www/whatjackhasmade.co.uk/html/wordpress/wp-content/plugins/amp/includes/class-amp-post-template.php(242): AMP_Content->__construct('<a href="http:/...', Array, Array, Array)
        #5 /var" while reading response header from upstream, client: 66.249.69.220, server: whatjackhasmade.co.uk, request: "GET /broken-son/amp/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.whatjackhasmade.co.uk"
        2017/06/25 16:57:21 [error] 1492#1492: *29 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php on line 675
        PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.noface.co.uk"
        2017/06/25 16:58:22 [error] 1492#1492: *41 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php on line 675
        PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 163.172.64.133, server: noface.co.uk, request: "GET //a2billing/customer/templates/default/footer.tpl HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "139.59.189.250"
        2017/06/25 16:59:28 [error] 1492#1492: *43 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Out of memory (allocated 713031680) (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/option.php on line 1103
        PHP message: PHP Fatal error:  Out of memory (allocated 713031680) (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.noface.co.uk"
        2017/06/25 16:59:32 [error] 1492#1492: *43 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Out of memory (allocated 354418688) (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/wp-db.php on line 1300
        PHP message: PHP Fatal error:  Out of memory (allocated 354418688) (tried to allocate 20480 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/plugin.php on line 449" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "www.noface.co.uk"
        2017/06/25 17:01:42 [error] 1492#1492: *72 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Out of memory (allocated 85983232) (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php on line 36
        PHP message: PHP Fatal error:  Out of memory (allocated 85983232) (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-includes/load.php on line 677
        PHP message: PHP Fatal error:  Out of memory (allocated 85983232) (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
        2017/06/25 17:01:55 [error] 1492#1492: *72 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Out of memory (allocated 41943040) (tried to allocate 262144 bytes) in /var/www/noface.co.uk/html/wordpress/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php on line 675
        PHP message: PHP Fatal error:  Out of memory (allocated 41943040) (tried to allocate 262144 bytes) in Unknown on line 0
        PHP message: PHP Fatal error:  Out of memory (allocated 41943040) (tried to allocate 262144 bytes) in Unknown on line 0" while reading response header from upstream, client: 82.1.145.76, server: noface.co.uk, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "noface.co.uk"
        

        Again, your help is very appreciated!

        • UPDATE: The website is now live. Thank you again for your help @hansen, you life saver! :)

          • @jacknoface
            So everything is working or not? I'm still getting a blank page, so I think you have a bad plugin or theme. It's not normal for WordPress to consume more than 700MB as noted in one of the errors (2017/06/25 16:59:28)

          • @jacknoface I can see it's working now - and very fast too. I must admit, your site is quite fast and I like the little logo animation a lot!

Thanks, @hansen turns out WP Total Cache plugin was the issue, I'll do some research into using an alternative plugin.

Thank you for the compliment on the logo, speed is one of my main focuses with websites, I aim for a 1 second load speed or as close as I can get :)

  • @jacknoface That's really awesome. Normally designers/coders don't care about speed and sites turn into 5-10 MB heavy downloads with an extreme amount of javascript. And thank you for using SVG instead of font icons!
    If you create something unique, you should send your site to Chris at css-tricks.com

    • Just noticed you're on codepen - which is his creation, so ignore that, since you probably follow his blog too :)

Have another answer? Share your knowledge.