为什么 php 报告 "failed to open stream" 定义了目录分隔符?
Why does php reports "failed to open stream" with Directory Separator Defined?
我在 C:\xampp\htdocs\Dove\Subsediaries\drugs 有一个 Web 目录。我已经定义了目录分隔符。请注意还缺少什么,因为脚本不是 运行。感恩!
defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
defined('SITE_ROOT') ? null : define ('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'].DS.'drugs');
defined('LIB_PATH') ? null : define ('LIB_PATH',SITE_ROOT.DS.'includes');
// load config file first
require_once(LIB_PATH.DS."config.php");
//load basic functions next so that everything after can use them
require_once(LIB_PATH.DS."functions.php");
require_once(LIB_PATH.DS."session.php");
require_once(LIB_PATH.DS."tbldrugs.php");
require_once(LIB_PATH.DS."tblmsg.php");
require_once(LIB_PATH.DS."users.php");
//Load Core objects
require_once(LIB_PATH.DS."database.php");
//load database-related classes
谢谢。我只是从 How do i use the DIRECTORY_SEPARATOR for Windows 的类似 post 中找出原因。我用
更正了 SITE_ROOT 定义
defined('SITE_ROOT') ? null : define('SITE_ROOT', 'C:'.DS.'xampp'.DS.'htdocs'.DS.'Dove'.DS.'Subsediaries'.DS.'drugs');
现在一切正常。谢谢 http://www.whosebug.com !
我在 C:\xampp\htdocs\Dove\Subsediaries\drugs 有一个 Web 目录。我已经定义了目录分隔符。请注意还缺少什么,因为脚本不是 运行。感恩!
defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
defined('SITE_ROOT') ? null : define ('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'].DS.'drugs');
defined('LIB_PATH') ? null : define ('LIB_PATH',SITE_ROOT.DS.'includes');
// load config file first
require_once(LIB_PATH.DS."config.php");
//load basic functions next so that everything after can use them
require_once(LIB_PATH.DS."functions.php");
require_once(LIB_PATH.DS."session.php");
require_once(LIB_PATH.DS."tbldrugs.php");
require_once(LIB_PATH.DS."tblmsg.php");
require_once(LIB_PATH.DS."users.php");
//Load Core objects
require_once(LIB_PATH.DS."database.php");
//load database-related classes
谢谢。我只是从 How do i use the DIRECTORY_SEPARATOR for Windows 的类似 post 中找出原因。我用
更正了 SITE_ROOT 定义 defined('SITE_ROOT') ? null : define('SITE_ROOT', 'C:'.DS.'xampp'.DS.'htdocs'.DS.'Dove'.DS.'Subsediaries'.DS.'drugs');
现在一切正常。谢谢 http://www.whosebug.com !