2013-07-07 54 views
0

我已經通過Xampp將google地圖應用到本地服務器。我已將它移到我的網站託管服務器,但無法連接到數據庫。我能夠得到其他數據庫連接的工作,但這裏的問題是我必須把錯誤的文件路徑。我使用的是與本地機器相同的文件結構。PHP/MySQL:路徑錯誤:[function.require]:無法打開流:

的錯誤:

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 

任何人都知道爲什麼,它現在可是不扔本地計算機上這些錯誤,我怎麼能去修復它?

我真的不知道從哪裏開始,甚至不知道如何說出這個問題。任何幫助,將不勝感激。謝謝

回答

1

你站在.../includes/states_map/phpsqlajax_genxml2.php並試圖達到「../includes/core/db/map_dbinfo.php」。如果您返回states_map中的一個目錄,則需要包含該目錄,然後嘗試在includes目錄下找到includes。

更改包括對../../includes/core/db/map_dbinfo.php

爲什麼發生這種情況?可能是因爲你在你的本地服務器上已經在你的r include_path中加入了.../includes在php中,然後將嘗試includes/../includes/...

+0

\ 0 /謝謝工作很好!將在4分鐘內答覆。 – user2526699

+0

也感謝你背後的邏輯。 – user2526699