【发布时间】:2018-05-11 17:10:00
【问题描述】:
我正在开发一个 php 项目,将项目文件存储在 OneDrive 上,以便我可以从任何地方访问它们。
我已经设置了 XAMPP,VirtualHost 指向我在 OneDrive 中的项目文件夹,以便我可以在浏览器中运行它。
直到昨天,当 OneDrive 开始崩溃并且我不得不重新安装它时,这一直运行良好。现在我不再能够运行存储在 OneDrive 上的 php 文件了。
我在浏览器中收到此错误:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'D:/OneDrive/MyProject/index.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0
我的 OneDrive 文件夹是 D:\OneDrive。如果我设置一个指向D:\ 的VirtualHost,我可以在我的浏览器中运行D:\index.php 或D:\MyProject\index.php 等文件。但我无法运行D:\OneDrive\index.php 或D:\OneDrive\MyProject\index.php 等文件。
有谁知道可能导致此问题的原因?
编辑:
该问题似乎与.htaccess 无关,因为该行为与项目文件夹中是否存在.htaccess 文件无关。
这是我的VirtualHost,如果有人感兴趣的话:
<VirtualHost *:80>
ServerAdmin webmaster@myproject.com
DocumentRoot "D:/OneDrive/MyProject/"
ServerName myproject.com
ServerAlias www.myproject.com
<Directory "D:/OneDrive/MyProject/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
【问题讨论】:
-
显示您的虚拟主机路径。以及 .htaccess 设置。
-
@DipanwitaKundu 查看我更新的问题。
-
我遇到了同样的问题。您的防病毒软件可能是问题所在。我正在使用 Bitdefender 并转到应用程序访问(在安全文件设置下),并授予 Apache 和 PHP CLI 权限。现在它可以工作了。