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
Is there anything else I can try or test? Are there any logs or additional information I can provide? Please let me know!
Update - Error messages from switching Wordpress debugging on, revised after debugging a few of the easy ones:
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 0
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 0
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
Final Update after Resolving Issue Line 34 in single-post.php has been updated to:
<?php } ?>
, was previously <? }?>