运行 php 个文件存储在 OneDrive 上
Running php files stored on OneDrive
我正在开发一个 php 项目,将项目文件存储在 OneDrive 上,以便我可以从任何地方访问它们。
我已经设置 XAMPP,VirtualHost
指向我在 OneDrive 中的项目文件夹,这样我就可以在我的浏览器中 运行 它。
直到昨天 OneDrive 开始崩溃,我不得不重新安装它时,它一直运行良好。现在我无法再 运行 php 文件存储在 OneDrive 上。
我在浏览器中收到此错误:
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>
我无法解决问题,但我找到了解决方法:
- 将项目文件存储在 OneDrive 之外。
- 将OneDrive文件夹中的symbolic link创建到OneDrive外部的项目文件夹中。
通过此设置,我可以 运行 我的 PHP 应用程序,因为项目文件实际上并未位于 OneDrive 文件夹中,并且项目文件仍上传并备份到OneDrive 由于符号 link.
我想你只需要在通知区域右键单击 OneDrive 的图标,选择设置 > 设置 > 并取消选中按需文件。
您可以选择保留它,但只需右键单击 OneDrive 中让您感到悲伤的文件夹,然后选择始终保留该文件夹的本地副本的选项。
我认为现在已修复 (2018-11-26) - 现在,网站可以在 OneDrive 中再次运行。我确定这是最近修复的 OneDrive 应用程序问题。
此错误仍未修复。 Windows2019 年 5 月 10 日更新后,该错误再次出现,并且未被 Microsoft 修复。
我正在开发一个 php 项目,将项目文件存储在 OneDrive 上,以便我可以从任何地方访问它们。
我已经设置 XAMPP,VirtualHost
指向我在 OneDrive 中的项目文件夹,这样我就可以在我的浏览器中 运行 它。
直到昨天 OneDrive 开始崩溃,我不得不重新安装它时,它一直运行良好。现在我无法再 运行 php 文件存储在 OneDrive 上。
我在浏览器中收到此错误:
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>
我无法解决问题,但我找到了解决方法:
- 将项目文件存储在 OneDrive 之外。
- 将OneDrive文件夹中的symbolic link创建到OneDrive外部的项目文件夹中。
通过此设置,我可以 运行 我的 PHP 应用程序,因为项目文件实际上并未位于 OneDrive 文件夹中,并且项目文件仍上传并备份到OneDrive 由于符号 link.
我想你只需要在通知区域右键单击 OneDrive 的图标,选择设置 > 设置 > 并取消选中按需文件。
您可以选择保留它,但只需右键单击 OneDrive 中让您感到悲伤的文件夹,然后选择始终保留该文件夹的本地副本的选项。
我认为现在已修复 (2018-11-26) - 现在,网站可以在 OneDrive 中再次运行。我确定这是最近修复的 OneDrive 应用程序问题。
此错误仍未修复。 Windows2019 年 5 月 10 日更新后,该错误再次出现,并且未被 Microsoft 修复。