在此先感谢您的帮助。 我花了很多时间试图找到解决方案,我通常不会寻求帮助。 服务器上Godaddy.com 这一切都很好,我的本地主机。PHP .DS。在godaddy
<?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 /包括/ initialize.php
的所有文件都在includes文件夹
这里是错误:)
警告: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');
?>
...编程是非常复杂的,但大部分的时间都花在搞清楚你做错了什么。
以及至少对我来说反正:)
这是很清楚的,不是吗?该文件不存在。另外,你可以在Windows和* nix上使用'/'。 – Brad
但该文件确实存在,并且它位于包含文件夹中。所有这些文件都在包含文件夹中。我不能改变.DS。到/因为有使用.DS的方法。而没有定义它,我将不得不把整个事情写下来。 – user3384868
您是否需要在godaddy上安装php或者是否自动安装。我有一天设立了一个新账户,我需要下一个让我的PHP访问服务器上的数据库mySQL。 www.jamesbond.ws是该网站。 – 2014-07-21 12:56:50