工具&利器

ecshop安装出现appserver不存在

解决方法

路径中文件夹的名字不能重复

wwwroot/ecshop/source/shop

wwwroot/ecshop/source/appserver

上面有两个ecshop文件夹名字只要把上面的末尾shop改成如下名字即可, 具体原因详见下面 <调试过程>

wwwroot/ecshop/source/web

wwwroot/ecshop/source/appserver

系统环境

liunx、nginx、php5.6、ecshop3.6

错误信息

调试过程

step1 查看安装文件shop/install/index.php

 79     case 'check' :
 80     include_once(ROOT_PATH . 'install/includes/lib_env_checker.php');
 81     include_once(ROOT_PATH . 'install/includes/checking_dirs.php');
 82     $dir_checking = check_dirs_priv($checking_dirs);

step2 由 check_dir_priv 函数在lib_env_checker.php

 30 function check_dirs_priv($checking_dirs)
 31 {
 32     include_once(ROOT_PATH . 'includes/lib_common.php');
 33 
 34     global $_LANG;
 35     $msgs = array('result' => 'OK', 'detail' => array());
 36 
 37     foreach ($checking_dirs AS $dir)
 38     {
 39         $path = ROOT_PATH;
 40         if(strstr($dir,'appserver')){
 41             $path_arr = explode('/',ROOT_PATH);
 42             $count = count($path_arr)-2;
 43             $name = $path_arr[$count].'/';
 44             $path = str_replace($name,'',ROOT_PATH);
 45         }

关键代码 $path = str_replace($name,”,ROOT_PATH);  就是这儿替换字符出现的问题. 通过var_dump($path)

出现 string(24) “/wwwroot/ecsource/” string(24) “/wwwroot/ecsource/” , 路径中的ecshop被替换 -_-!

ps: 正确的路径应该为/wwwroot/ecshop/source/

发表评论