PHP/MySQL : Path Error: [function. require]:无法打开流:

标签 php mysql database google-maps

我已通过 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/

相关文章:

mysql - 服务器上的 SQL : Saving Query Statements to a File

php - Composer : no matching package found

php - 如何在Wordpress上添加搜索过滤器?

mysql - 如何显示在 MySQL 上执行的最后一个查询?

java - 如何通过Eclipse RCP连接Mysql

arrays - 在 R 中将多列转换为 Json 数组?

php - mysql 2个表,从2个表中获取结果

php - 给 Laravel Livewire 组件加水和脱水是什么意思?

python - 使用Python将CSV数据加载到MySQL中,创建表并添加记录

使用索引时的 MySQL 查询优化