运行存储在 OneDrive 上的 php 文件
我正在开发一个 php 项目,将项目文件存储在 OneDrive 上,以便我可以从任何地方访问它们.
我已经设置了 XAMPP,VirtualHost
指向我在 OneDrive 中的项目文件夹,以便我可以在浏览器中运行它.
直到昨天,当 OneDrive 开始崩溃并且我不得不重新安装它时,它一直运行良好.现在我不再能够运行存储在 OneDrive 上的 php 文件了.
我在浏览器中收到此错误:
警告:未知:无法打开流:第 0 行的未知中没有此类文件或目录致命错误:未知:在第 0 行的未知中打开所需的D:/OneDrive/MyProject/index.php"(include_path='C:xamppphpPEAR')失败
我的 OneDrive 文件夹是 D:OneDrive
.如果我设置了一个指向 D:
的 VirtualHost
,我可以运行 D:index.php
或 等文件>D:MyProjectindex.php
在我的浏览器中.但我无法运行 D:OneDriveindex.php
或 D:OneDriveMyProjectindex.php
等文件.
有谁知道可能导致此问题的原因?
该问题似乎与 .htaccess
无关,因为该行为与项目文件夹中是否存在 .htaccess
文件无关.p>
这是我的VirtualHost
,以防有人感兴趣:
<VirtualHost *:80>ServerAdmin webmaster@myproject.comDocumentRoot "D:/OneDrive/MyProject/"服务器名称 myproject.comServerAlias www.myproject.com<目录D:/OneDrive/MyProject/">选项索引 FollowSymLinks MultiViews允许覆盖所有需要本地</目录></虚拟主机>
解决方案 我没能解决这个问题,但我找到了解决方法:
- 将项目文件存储在 OneDrive 之外.
- 制作一个 符号链接在 OneDrive 文件夹中指向 OneDrive 之外的项目文件夹.
通过此设置,我可以运行我的 PHP 应用程序,因为项目文件实际上并不位于 OneDrive 文件夹中,并且由于符号链接,项目文件仍会在 OneDrive 上上传和备份.
I am developing a php project, having the project files stored on OneDrive so that I can access them from anywhere.
I have set up XAMPP, with a VirtualHost
pointing to my project folder inside OneDrive so that I can run it in my browser.
This has been working great up until yesterday, when OneDrive started crashing and I had to reinstall it. Now I'm no longer able to run php files stored on OneDrive.
I get this error in my browser:
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:xamppphpPEAR') in Unknown on line 0
My OneDrive folder is D:OneDrive
. If I set up a VirtualHost
pointing to D:
, I am able to run files such as D:index.php
or D:MyProjectindex.php
in my browser. But I'm not able to run files such as D:OneDriveindex.php
or D:OneDriveMyProjectindex.php
.
Does anyone have an idea what might cause this issue?
Edit:
The issue does not seem to be related to .htaccess
, as the behavior is independent of whether a .htaccess
file exists in the project folder or not.
Here is my VirtualHost
, in case anyone is interested:
<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>
解决方案
I've not been able to solve the issue, but I've found a workaround:
- Store the project files outside of OneDrive.
- Make a symbolic link in the OneDrive folder to the project folder outside of OneDrive.
With this setup I'm able to run my PHP application, since the project files are not physically located in the OneDrive folder, and the project files are still uploaded and backed up on OneDrive due to the symbolic link.
相关文章