【发布时间】:2011-12-01 19:28:39
【问题描述】:
我一直对 PHP 的 include 函数有疑问。我正在制作一个商店网站,并创建了一个购物车。我希望它在几页的每个侧边栏中,所以我使用包含。
在文件 /public_html/product/index.php 的第 37 行:
include("converter.php");
文件converter.php位于/public_html/include/converter.php
有时它似乎可以工作,但大多数时候它会显示:
警告:include(converter.php) [function.include]:无法打开流:第 37 行的 /public_html/product/index.php 中没有这样的文件或目录
然后
警告:include() [function.include]:无法在 /home/ 中打开 'converter.php' 以包含 (include_path='.:/usr/lib/php:/usr/local/lib/php') a3371827/public_html/product/index.php 第 37 行
我是否遗漏了一些关于包含的内容?
【问题讨论】: