问题描述
我有一个PHP网站,其中包含一个后端批处理/CRON作业,该作业经常运行并处理照片.Web和数据库服务器以及RAID存储是Fedora 14盒,并且照片软件在存储服务器上的Windows 7 VirtualBox中运行.
I have a PHP website with a backend batch/CRON job that runs ever so often and processes photos. The web and database servers and RAID storage are Fedora 14 boxes and the photo software runs in a Windows 7 VirtualBox on the storage server.
存储阵列作为共享文件夹加载,并在网络位置"下显示为E:\.
The storage array is loaded as a shared folder and shows up as E:\ under Network Locations.
PHP exec命令每分钟通过PHP-CLI运行一次,如下所示:
The PHP exec command runs every minute via PHP-CLI looks like this:
exec("C:\\service\\photo_edit.exe --input-file E:\\photos\\photo_example.jpg --effect crossprocess --output-file E:\\photos\\user\\finished_example.jpg")
直接在命令行中运行命令即可.问题是,即使我可以通过命令提示符访问它,PHP似乎也根本不使用E:\.我还必须将Windows保留在VirtualBox中,因为我有更多服务可以编辑文件并在Linux中运行.
Running the command directly in the command line works. The thing is, PHP can't seem to use E:\ at all, even though I can access it through the Command Prompt. I also have to keep Windows in a VirtualBox because I have more services that edit files and run in Linux.
我需要PHP才能使用Windows内Web存储上的这些文件.
I need PHP to be able to work with these files on the web storage inside Windows.
推荐答案
这不是权限问题.映射到驱动器号的网络共享是每个用户的设置.用户Apache运行时没有共享映射为 E:
.
It isn't a permissions issue. Network shares mapped to a drive letter are a per-user setting. The user Apache runs as does not have that share mapped as E:
.
替代方法包括:
- 使用UNC语法:
\\ vboxsvr \任何内容
- 为当前Apache用户映射驱动器(LOCAL_SYSTEM?)—
- 更改运行Apache服务的用户
这篇关于VirtualBox Windows-Guest共享文件夹上的PHP权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!