首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用Include包含Files

无法使用Include包含Files
EN

Stack Overflow用户
提问于 2012-06-05 17:29:12
回答 1查看 1.7K关注 0票数 1

我有一个名为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

它在本地主机上运行良好,但当我在域上发布页面时会出错。

有人知道为什么这不管用吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-05 17:31:36

/表示绝对路径,这意味着脚本正在文件系统的根目录中查找一个名为interests的目录。

相反,只需在路径开始时移除该/,或将$_SERVER['DOCUMENT_ROOT']添加到它们的前面。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10901993

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档