duanqianmou4661 2018-02-08 05:30
浏览 68

WordPress从Apache迁移到Nginx后,永久链接的帖子空白

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

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 <? }?>

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?