fopen won't open files across network

断了今生、忘了曾经 提交于 2020-01-21 10:26:06

问题


I can use fopen to open local files but can't open files across network on a different machine. I can map the drives and look at the files but can't open them using fopen.


回答1:


Assuming you're running Apache on Windows (since you talk about "mapping" the drive):

If you used the defaults during installation then apache is running with the Local System account, which doesn't have any network privileges. So you have to make sure it runs as a (domain) user that can access the network drive(s). You can change this via Control Panel, Administrative Tools, Services (right click on Apache, select Properties and select a user on the Log On tab).




回答2:


In order to open remote files you need to have the php.ini setting "allow_url_fopen" enabled. Is that the case in your settings?



来源:https://stackoverflow.com/questions/2874796/fopen-wont-open-files-across-network

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!