我已通过 Xampp 将谷歌地图应用到我的本地服务器。我已将其移至我的网络托管服务器,但无法将其连接到数据库。我能够让其他数据库连接正常工作,但这里的问题是我必须错误地输入文件路径。我使用与本地计算机相同的文件结构。
错误:
Warning: require(../includes/core/db/map_dbinfo.php) [function.require]: failed to open stream: No such file or directory in /home/xxxxxxx/public_html/includes/state_map/phpsqlajax_genxml2.php on line 2
Fatal error: require() [function.require]: Failed opening required '../includes/core/db/map_dbinfo.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxxxx/public_html/includes/state_map/phpsqlajax_genxml2.php on line 2
有人知道为什么它现在抛出这些错误但不在本地计算机上,我该如何修复它?
我真的不知道从哪里开始,甚至不知道如何表达这个问题。任何帮助,将不胜感激。谢谢
最佳答案
您正站在 .../includes/states_map/phpsqlajax_genxml2.php
并尝试访问“../includes/core/db/map_dbinfo.php
” 。如果您从 states_map
返回一个目录,您将看到 include,然后您尝试在includes 目录下查找includes。
将包含内容更改为../../includes/core/db/map_dbinfo.php
为什么会发生这种情况?可能是因为您在本地服务器上在 php 中的 include_path
中添加了 .../includes
,然后它将尝试 includes/../includes/。 ..
关于PHP/MySQL : Path Error: [function. require]:无法打开流:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17515880/