【问题标题】:PHP Fatal error with nginxnginx的PHP致命错误
【发布时间】:2019-02-19 01:49:50
【问题描述】:

在 PHP 表单中,当我在 Wordpress 主题中作为订阅者提交一封电子邮件时,error.log 中出现下一个错误:

2013/08/03 21:39:22 [错误] 19544#0: *11 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(TEMPLATEPATH/functions/theme-functions.php): failed to open stream: No such file or directory in /web/domain.com/public/wp-content/themes/launcheffect/functions.php on line 151

PHP 消息:PHP Fatal error: require_once(): Failed opening required 'TEMPLATEPATH/functions/theme-functions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /web/domain.com/public/wp-content/themes/launcheffect/functions.php on line 151" while reading response header from upstream, client: 71.28.74.212, server: www.domain.com, request: "POST /wp-content/themes/launcheffect/post.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com", referrer: "http://www.domain.com/"

我一直在阅读关于权限、关于 nginx 和 fastcgi、关于 PHPfpm、查看我的配置......但没有成功。此外,我的其他网站运行良好,而且该主题几天前运行良好。

我当然有那个文件/目录。

我的 nginx.conf:

http://pastebin.com/5VB1BzHj

谁能帮我解决这个错误?

提前致谢!

【问题讨论】:

  • 似乎TEMPLATEPATH 正在按原样输出。它应该被连接起来:TEMPLATEPATH . functions/theme-functions.php
  • 对不起,你能再解释一下吗?在此先感谢:)
  • 好的,我用 strace 得到了它,但我看不到什么特别的东西:(还有其他想法吗?

标签: wordpress nginx fastcgi php


【解决方案1】:

查看您的示例错误,您似乎没有正确格式化要求。它应该看起来像这样:

require_once(TEMPLATEPATH . '/functions/theme-functions.php');

确保您也在定义您的 TEMPLATEPATH。

define("TEMPLATEPATH ", "/this/is/your/path");

最后,这应该输出一个字符串:

/this/is/your/path/functions/theme-functions.php

【讨论】:

    【解决方案2】:

    对于遇到此问题的任何人,请仔细检查您的文件路径和文件名,因为我是由区分大小写的文件路径引起的,其中我错过了一个大写字母

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-16
      • 1970-01-01
      • 2012-06-24
      相关资源
      最近更新 更多