-1

可能重复:
无法打开流:参数无效

// Define the core paths
// Define them as absolute paths to make sure that require_once works as expected

// DIRECTORY_SEPARATOR is a PHP pre-defined constant
// (\ for Windows, / for Unix)
defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);

defined('SITE_ROOT') ? null : 

define('SITE_ROOT', DS.'C:'.DS.'wamp'.DS.'www'.DS.'photo_gallery');

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');

// load core objects
require_once(LIB_PATH.DS.'session.php');
require_once(LIB_PATH.DS.'database.php');

// load database-related classes
require_once(LIB_PATH.DS.'user.php');

每当我尝试通过在地址栏 localhost/photo_gallery/public/admin/index.php 中输入来运行此代码。它将显示如下错误:

警告:require_once(\C:\wamp\www\photo_gallery\includes\config.php):未能打开流:C:\wamp\www\photo_gallery\includes\initialize.php 中的参数无效,第 16 行。

致命错误:require_once():在 C:\wamp\www\photo_gallery 中打开所需的 '\C:\wamp\www\photo_gallery\includes\config.php'(include_path='.;C:\php\pear') 失败\includes\initialize.php 在第 16 行

请告诉我该怎么办?我是一个初学者启动网页设计师,我被这个致命错误卡住了。

4

1 回答 1

0

DS在以下行中是额外的:

定义('SITE_ROOT',DS.'C:'.DS.'wamp'.DS.'www'.DS.'photo_gallery');

请删除它,使其成为

define('SITE_ROOT', 'C:'.DS.'wamp'.DS.'www'.DS.'photo_gallery');

使用定义代替定义

于 2012-12-07T06:34:40.960 回答