站点迁移linux->本地wamp,Apache错误日志显示最奇怪的路径

时间:2015-02-22 22:36:24

标签: php apache path wamp

首先,摘录错误:

[Sun Feb 22 19:17:56.601528 2015] [:error] [pid 16408:tid 1528] [client ::1:61136] PHP Stack trace:
[Sun Feb 22 19:17:56.601528 2015] [:error] [pid 16408:tid 1528] [client ::1:61136] PHP   1. {main}() C:\\wamp\\www\\thesite\\domains\\thesite\\public_html\\index.php:0
[Sun Feb 22 19:17:56.601528 2015] [:error] [pid 16408:tid 1528] [client ::1:61136] PHP   2. include() C:\\wamp\\www\\thesite\\domains\\thesite\\public_html\\index.php:12
[Sun Feb 22 19:17:56.602528 2015] [:error] [pid 16408:tid 1528] [client ::1:61136] PHP Warning:  include(): Failed opening 'phpMail.php' for inclusion
(include_path='.;C:\\php\\pear
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/lib/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/admin/lib/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/b2evo_captcha/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/b2evo_captcha/b2evo_captcha_fonts/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/b2evo_captcha/b2evo_captcha_tmp/
:C:\\wamp\\www\\thesite\\domains\thesite\\public_html/stdlib/fonts/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/html/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/krumo/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/krumo/docs/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/krumo/docs/Krumo/
:C:\\wamp\\www\\thesite\\domains\\thesite\\public_html/stdlib/k 
in C:\\wamp\\www\\thesite\\domains\\thesite\\public_html\\config.php on line 152

来自autoconf.php,看似与路径有关......

    $path = realpath("./").'/';
if (preg_match("/(.*)\/admin\//", $path, $path1)) {
   $path = $path1[1].'/';
}
$CFG["path"]["www"] = $path.'\\';
$url_www = '/';
if (preg_match("/.*\/public_html\/(.*)\//", $path, $matches)) {
   if (preg_match("/^\/{$matches[1]}\/*/", $_SERVER["REQUEST_URI"], $kk)) {
      $url_www = '/'.$matches[1].'/';
   }
}
$CFG["url"]["www"] = $url_www;


$CFG["theme"] = "thesite";

最后,config.php,开放行:

require_once("autoconf.php");
// path (with trailing slashes)
$CFG["path"]["admin"] = $CFG["path"]["www"] . "admin/";
$CFG["path"]["ext"] = $CFG["path"]["www"] . "ext/";
$CFG["path"]["public"] = $CFG["path"]["www"] . "public/";
$CFG["path"]["js"] = $CFG["path"]["ext"] . "js/";
$CFG["path"]["font"] = $CFG["path"]["ext"] . "font/";
$CFG["path"]["files"] = $CFG["path"]["public"] . "files/";
// url (with trailing slashes)
$CFG["url"]["admin"] = $CFG["url"]["www"] . "admin/";
$CFG["url"]["ext"] = $CFG["url"]["www"] . "ext/";
$CFG["url"]["public"] = $CFG["url"]["www"] . "public/";
$CFG["url"]["js"] = $CFG["url"]["ext"] . "js/";
$CFG["url"]["font"] = $CFG["url"]["ext"] . "font/";
$CFG["url"]["files"] = $CFG["url"]["public"] . "files/";
$CFG["url"]["css"] = $CFG['url']['www'].'theme/'.$CFG['theme'].'/css/';

// lib path (with trailing slashes)
$CFG["path"]["lib"] = array(
    $CFG["path"]["www"] . "stdlib/",
    $CFG["path"]["www"] . "lib/",
    $CFG["path"]["admin"] . "lib/"
);

// libraries (don't touch)
//////////////////////////////////////

// add our lib path's to php include path
setLibPath($CFG["path"]["lib"]);

//captcha
include("phpMail.php");

好吧,基本上日志对于通过

包含的每个库都有错误
  

包括()

到config.php

到目前为止,我在查看配置文件中的所有内容时感到眩晕,不是最大的PHP王牌。

但我确实觉得我在那里的某个地方忽略了一些非常简单的东西,与路径以及它们的构造方式有关。

男孩,所有这些反冲都让我生病了......

1 个答案:

答案 0 :(得分:0)

看起来你的php.ini中的include_path(phpForApache.ini)在文件夹之间有:冒号分隔符,那就是UNIX说话。

我猜您遵循的是针对UNIX而不是Windows的安装教程。

include_path更改为使用半冒号;作为分隔符,并同时删除不存在的文件夹,例如C:/php/pear

include_path=".;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/
;C:\wamp\www\thesite\domains\thesite\public_html/lib/
;C:\wamp\www\thesite\domains\thesite\public_html/admin/lib/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/b2evo_captcha/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/b2evo_captcha/b2evo_captcha_fonts/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/b2evo_captcha/b2evo_captcha_tmp/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/fonts/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/html/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/krumo/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/krumo/docs/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/krumo/docs/Krumo/
;C:\wamp\www\thesite\domains\thesite\public_html/stdlib/k