我有一个名为index.php的页面,它包含一个页面new_display.php,它再次包含两个页面,比如x.php和y.php
包含在本地主机上工作很好,但在我的主机上不工作!我所犯的错误是:-
/hermes/bosweb/web054/b548/ipg.pingcampuscom/mysql/interests/sketching/new_display.php警告: function.require: function.require:未打开流:第154行中没有这样的文件或目录
(include_path='.:/usr/local/lib/php-5.2.17/lib/php')致命错误: /hermes/bosweb/web054/b548/ipg.pingcampuscom/mysql/interests/sketching/new_display.php中的() function.require:打开失败需要‘/interests/草图/udis.php’
目录是:
index.php -> localhost/mysql
localhost/mysql/interests/sketching/new_display.php (包含在index.php /interests/草图/ new_display.php _display.php中)
然后在new_display中,x.php和y.php包括在
/interests/sketching/x.php
/interests/sketching/y.php
它在本地主机上运行良好,但当我在域上发布页面时会出错。
有人知道为什么这不管用吗?
发布于 2012-06-05 17:31:36
/表示绝对路径,这意味着脚本正在文件系统的根目录中查找一个名为interests的目录。
相反,只需在路径开始时移除该/,或将$_SERVER['DOCUMENT_ROOT']添加到它们的前面。
https://stackoverflow.com/questions/10901993
复制相似问题