Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用 fopen 打开本地文件,但无法通过网络在另一台机器上打开文件。我可以映射驱动器并查看文件,但无法使用 fopen 打开它们。
假设您在 Windows 上运行 Apache(因为您谈论“映射”驱动器):
如果您在安装过程中使用默认设置,则 apache 使用本地系统帐户运行,该帐户没有任何网络权限。因此,您必须确保它以可以访问网络驱动器的(域)用户身份运行。您可以通过控制面板、管理工具、服务更改此设置(右键单击 Apache,选择属性并在登录选项卡上选择一个用户)。
为了打开远程文件,您需要启用 php.ini 设置“allow_url_fopen”。你的设置是这样的吗?