提前感谢您的帮助。 我花了很多时间试图找到解决方案,我通常不会寻求帮助。 服务器在Godaddy.com上 这一切都在我当地的主人身上很有效。
<?php require_once("../includes/initialize.php"); ?>
// this is the initialize.php file
<?php
// 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.'webroot'.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');
require_once(LIB_PATH.DS.'database_object.php');
require_once(LIB_PATH.DS.'pagination.php');
require_once(LIB_PATH.DS.'phpMailer'.DS.'class.phpmailer.php');
require_once(LIB_PATH.DS.'phpMailer'.DS.'class.smtp.php');
// load database-related classes
require_once(LIB_PATH.DS.'user.php');
require_once(LIB_PATH.DS.'photograph.php');
require_once(LIB_PATH.DS.'comment.php');
?>
这是godaddy上文件管理器右上角的路径。 webroot / photo_gallery / includes / initialize.php
所有文件都在包含文件夹
中这是错误:)
警告:require_once(/webroot/photo_gallery/includes/config.php):无法打开流:/home/content/43/7465643/html/photo_gallery/includes/initialize.php上没有这样的文件或目录16
好的网站不会让我回答我自己的问题,所以这就是答案。
感谢Quixrick在这里是工作代码:
<?php
$webroot = "home/content/43/7465643/html/";
// 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.$webroot.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');
require_once(LIB_PATH.DS.'database_object.php');
require_once(LIB_PATH.DS.'pagination.php');
require_once(LIB_PATH.DS.'PHPMailer'.DS.'class.phpmailer.php');
require_once(LIB_PATH.DS.'PHPMailer'.DS.'class.smtp.php');
// load database-related classes
require_once(LIB_PATH.DS.'user.php');
require_once(LIB_PATH.DS.'photograph.php');
require_once(LIB_PATH.DS.'comment.php');
?>
......编程非常复杂,但大部分时间都花在了解你做错了什么。
至少对我来说是好的:)。
答案 0 :(得分:1)
您的网络根目录设置为webroot
而不是/home/content/43/7465643/html
。设置此行时可能需要使用变量:
define('SITE_ROOT', DS.'webroot'.DS.'photo_gallery');
也许是这样的?
define('SITE_ROOT', DS.$webroot.DS.'photo_gallery');
或者如果它是一个常数,请取出它周围的引号:
define('SITE_ROOT', DS.webroot.DS.'photo_gallery');