Question
🤔 Permalinked Posts Blank after Wordpress Migrated to Nginx from Apache
Hopeful for some guidance on an issue. Background:
- Server is Digital Ocean with Ubuntu 14.04.04 running Nginx
- nginx version: nginx/1.10.1
- mysql Ver 14.14 Distrib 5.6.33, for debian-linux-gnu (x86_64)
- PHP 5.5.9-1ubuntu4.22 (cli) (built: Aug 4 2017 19:40:28)
- URL of the Wordpress is DocoSacramento.com
- Wordpress was migrated from an Apache server
- Pages work great! (such as http://docosacramento.com/explore/dine/ or http://www.docosacramento.com/about/)
- Issue: Posts show up as blank white pages when visited (such as http://www.docosacramento.com/blog/grandest-openings-punch-bowl-social/ or http://www.docosacramento.com/news/another-sales-milestone-residences-sawyer-penthouses-sold/)
- The posts follow the permalink structure of “docosacramento.com/%category%/%postname%/” (refer to the following image for a visual) permalinks settings screenshot
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 “WPDEBUGDISPLAY” 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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Update after resolving some of the errors, the only ones which remain are:
Not sure what the issue is on single-post.php… does anyone notice anything??