运行OneDrive上存储的php文件

Mag*_*eit 6 php apache xampp onedrive

我正在开发一个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
Run Code Online (Sandbox Code Playgroud)

我的OneDrive文件夹是D:\OneDrive。如果我将VirtualHost鼠标指向D:\,则可以运行诸如D:\index.phpD:\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>
Run Code Online (Sandbox Code Playgroud)

Mag*_*eit 6

我无法解决该问题,但我找到了解决方法:

  1. 将项目文件存储在 OneDrive 外部。
  2. 在 OneDrive 文件夹中创建指向 OneDrive 外部项目文件夹的符号链接。

通过此设置,我可以运行我的 PHP 应用程序,因为项目文件实际上并不位于 OneDrive 文件夹中,并且由于符号链接,项目文件仍然上传并备份在 OneDrive 上。