移动主机时需要一次错误



我把我的网站移到了一个新主机上,它没有加载。(以前在我的本地服务器或以前的2台主机上没有遇到过这个问题)。

我的index.php的第一行是:

require_once("includes/initialize.php");

然后初始化应该加载include/config.php:

 defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
 defined('SITE_ROOT')? null : 
    define('SITE_ROOT', '/webspace/httpdocs'.DS.'sitename.com');
 defined('LIB_PATH') ? null : define('LIB_PATH', SITE_ROOT.DS.'includes');
 require_once(LIB_PATH.DS.'config.php');

这些错误在日志文件中。。。

PHP警告:require_one(/webspace/httpdocs/sitename.com/includes/config.php):无法打开流:中没有这样的文件或目录/usr/local/pem/vhosts/253981/webspace/httpdocs/sitename.com/includes/initialize.php在线11

PHP致命错误:require_once():打开失败'/webspace/httpdocs/sitename.com/includes/config.php'(include_path='.:/usr/share/pear:/usr/share/php')/usr/local/pem/vhosts/253981/webspace/httpdocs/sitename.com/includes/initialize.php在线11

两个主机都使用PHP 5.3。
以下是我(从phpinfo)可以看到的主要区别。

旧主机:

  • PHP版本:5.3.22
  • 服务器API:CGI/FastCGI
  • 加载的配置文件:/usr/local/lib/php.ini
  • include_path:。:/usr/lib/php:/usr/local/lib/php

新主机:

  • PHP版本:5.3.3
  • 服务器API:Apache 2.0处理程序
  • 加载的配置文件:/etc/php.ini
  • include_path:。:/usr/share/pear:/usr/share.php

我在这里的知识是有限的。我不知道这些设置实际上是如何导致上面列出的错误的。是否还有其他我应该查找的设置?

如有任何帮助,我们将不胜感激。

您似乎设置了不正确的基本路径

/webspace应为/usr/local/pem/vhosts/253981/webspace

defined('SITE_ROOT') ? null : define('SITE_ROOT', '/usr/local/pem/vhosts/253981/webspace'.DS.'sitename.com');

最新更新