Report this

What is the reason for this report?

šŸ¤” Permalinked Posts Blank after Wordpress Migrated to Nginx from Apache

Posted on February 8, 2018

Hopeful for some guidance on an issue. Background:

My Nginx Server Block is currently as follows:

upstream php {
        server unix:/run/php-fpm/php-fpm.sock;
}

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /var/www/docosacramento.com/public_html;
        index index.php index.html index.htm;

        server_name docosacramento.com www.docosacramento.com;

        if (!-e $request_filename) {
                rewrite ^(.*)$ /index.php?q=$1 last;
        }

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

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

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
                include fastcgi_params;
                fastcgi_cache_key $host$request_method$request_uri;
        }
}

I’m guessing that perhaps location blocks are needed for each of the 4 post categories this website has (which are news, blog, gallery, and press-release) so I created a location /news {… block for testing but that does not seem to have made any changes when visiting posts that begin with /news/. Also, I’ve been sure to run the following commands each time I’ve edited the Nginx server block:

  • sudo nginx -t
  • sudo service nginx restart
  • sudo service php5-fpm restart

Additionally, before I set ā€œWP_DEBUG_DISPLAYā€ to false with define( 'WP_DEBUG_DISPLAY', false );, I was getting the following at the top of my pages:


Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50557 Library:50630 in /var/www/docosacramento.com/public_html/wp-includes/wp-db.php on line 1531

Notice: Use of undefined constant WPE_CLUSTER_ID - assumed 'WPE_CLUSTER_ID' in /var/www/docosacramento.com/public_html/wp-content/mu-plugins/wpengine-common/plugin.php on line 14

Strict Standards: Declaration of sidebar_walker::start_el() should be compatible with Walker_Page::start_el(&$output, $page, $depth = 0, $args = Array, $current_page = 0) in /var/www/docosacramento.com/public_html/wp-content/themes/downtown-commons/functions.php on line 52

Strict Standards: Declaration of themeslug_walker_nav_menu::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /var/www/docosacramento.com/public_html/wp-content/themes/downtown-commons/functions.php on line 52

Notice: Use of undefined constant PWP_NAME - assumed 'PWP_NAME' in /var/www/docosacramento.com/public_html/wp-content/mu-plugins/wpengine-common/wpe-sec.php on line 63

Parse error: syntax error, unexpected end of file in /var/www/docosacramento.com/public_html/wp-content/themes/downtown-commons/single-post.php on line 52

Is there anything else I can try or test? Please let me know! Really stumped on this! I Appreciate anyone taking a look at this issue, and thanks so much in advance for any insight!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.