【问题标题】:Nginx Fastcgi Wordpress 404 Not Found Error For Js and Css FilesJs 和 Css 文件的 Nginx Fastcgi Wordpress 404 Not Found 错误
【发布时间】:2013-11-27 21:18:23
【问题描述】:

我的 VPS 上安装了 nginx、php5-fpm、memcache 和 wordpress。 js 和 css 文件出现 404 错误。

错误;

[error] 21795#0: *35355 open() "/var/www/example.com/public_html/var/www/example.com/public_html/wp-content/themes/example/includes/classes/meta-box/js/color.js" failed (2: No such file or directory), client: 88.243.124.30, server: www.example.com, request: "GET /var/www/example.com/public_html/wp-content/themes/example/includes/classes/meta-box/js/color.js?ver=4.1.1 HTTP/1.1", host: "www.example.com", referrer: "http://www.example.com/wp-admin/post.php?post=1&action=edit&message=1"
[error] 19044#0: *13800 open() "/var/www/example.com/public_html/ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js" failed (2: No such file or directory), client: 101.226.33.206, server: www.example.com, request: "GET //ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js HTTP/1.1", host: "www.example.com", referrer: "http://www.example.com//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"

可能是什么问题?

谢谢

【问题讨论】:

    标签: wordpress nginx fastcgi


    【解决方案1】:

    在第一种情况下,您尝试通过文件的绝对路径加载文件。你有的地方

    <script src="/var/www/example.com/public_html/wp-content/themes/example/includes/classes/meta-box/js/color.js?ver=4.1.1"><script>
    

    而不是它的相对网址

    <script src="/wp-content/themes/example/includes/classes/meta-box/js/color.js?ver=4.1.1"><script>
    

    在第二种情况下,您尝试通过相对 url 加载文件

    <script src="/ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"><script>
    

    而不是使用绝对的

     <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"><script>
    

    我不知道为什么会这样,但您应该重新检查您的 wp_options 表以查看您设置的 URL。

    【讨论】:

    • 也许你是对的,但我试过没有任何改变我认为问题出在 post.php
    猜你喜欢
    • 1970-01-01
    • 2015-02-20
    • 2020-05-07
    • 1970-01-01
    • 1970-01-01
    • 2021-12-27
    • 2018-05-03
    • 1970-01-01
    • 2020-02-04
    相关资源
    最近更新 更多