我从另一位设计师那里挑选了一个网站,它全是 php,我在使用 wordpress 时只知道一点点。
这是我的问题,我点击了一个链接,该链接本应在网站上打开一个照片页面,但没有获取该页面:www.willowbeach.com/our-cottages-photos.php 我明白了:
警告:要求(/home/willowbe/public_html/db/db_class.inc.php):无法打开流:/hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/中没有这样的文件或目录willowbeach/db/application_top.php on line 14 Fatal error: require(): Failed opening required '/home/willowbe/public_html/db/db_class.inc.php' (include_path='.:/usr/local/lib/php -5.5.22-amd64/lib/php') 在/hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach/db/application_top.php 第 14 行
我知道这与路径是本地系统路径而不是 Web 目录路径这一事实有关。但我不知道去哪里解决这个问题。任何帮助将非常感激。
最佳答案
如果您仔细阅读错误,它会准确告诉您去哪里以及 PHP 试图做什么:
PHP 正在尝试运行
require(/home/willowbe/public_html/db/db_class.inc.php)
位于
/hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach/db/application_top.php
第 14 行。
它无法在那里找到文件,因此出错。
现在,将此网站放入一个复杂的目录树中,例如 /hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach
对我来说似乎过于复杂,但我相信您有理由这样做把它放在那里。
从第 14 行的 application_top.php
开始,您必须找到对 /home/willowbe/public_html/
的所有完整路径引用,并将它们替换为 /hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach/
所以这些文件是由 php 找到的。
关于PHP 错误 - 无法打开流 - 没有 PHP 专业知识,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36990525/