0
由於某些原因,file_get_contents不允許我獲取位於同一服務器上的文件。file_get_contents()連接拒絕本地文件url
這是我得到的錯誤:
file_get_contents(http://www.my-url.com/image.jpg): failed to open stream: Connection refused
我知道我可以使用系統路徑來獲取文件,但在這種情況下,我需要能夠與URL來進行測試。
檢查你的php.ini,是「allow_url_fopen = On」。 – vaso123 2014-11-06 13:40:46
如果他們在同一臺服務器上,爲什麼不使用文件系統路徑? – jeroen 2014-11-06 13:47:41
allow_url_fopen已經打開,並且我無法使用系統路徑,因爲我使用的是需要URL的WordPress功能 – Raven87 2014-11-06 13:54:34