简体   繁体   English

如何从安装在 Windows 10 上的 Wampserver 3 编辑/保存远程共享文件夹中的文件?

[英]How to edit / save files on remote shared folder from Wampserver 3 installed on Windows 10?

it's been for a while that I'm trying to save files to a remote shared folder (\\192.168.1.134) from my Wampserver on a windows host.我已经有一段时间试图将文件从 Windows 主机上的 Wampserver 保存到远程共享文件夹 (\\192.168.1.134)。 I run a .bat script from PHP but nothing is saved.我从 PHP 运行 .bat 脚本,但没有保存任何内容。 The script run well because I can execute it from a CMD prompt and I can also run another .bat script with PHP that write into a .txt (on the host).该脚本运行良好,因为我可以从 CMD 提示符执行它,我还可以使用 PHP 运行另一个 .bat 脚本,该脚本写入 .txt(在主机上)。

So there it is, I'm sure it's not because of my PHP script, but on permissions that Wampserver got (I can easily write and edit file on the shared folder with host).所以就是这样,我确定这不是因为我的 PHP 脚本,而是因为 Wampserver 获得的权限(我可以轻松地在与主机的共享文件夹上编写和编辑文件)。

I read that Wampserver may run as another User, but I didn't understand how to do it.我读到 Wampserver 可以作为另一个用户运行,但我不明白该怎么做。 Then, even if I change the User, where can I check if it has permissions to edit files in the shared folder ?那么,即使我更改了用户,我在哪里可以检查它是否有权编辑共享文件夹中的文件?

Thanks for any help !谢谢你的帮助 !

WAMPServer or rather Apache in WAMPServer is (luckily and correctly) setup so that Apache cannot get access to anything other than what it is supposed to. WAMPServer 或 WAMPServer 中的 Apache 已(幸运且正确)设置,以便 Apache 无法访问除它应该访问的内容之外的任何内容。 Its a security thing, so if your site gets hacked a hacker does not get carte blanche to access anything anywhere.这是一个安全问题,因此如果您的网站遭到黑客入侵,黑客将无法全权访问任何地方的任何内容。 So you need to setup an Alias within the Virtual Host for this site you are currently dealing with to allow Apache access to this other area因此,您需要在当前正在处理的此站点的虚拟主机中设置别名,以允许 Apache 访问其他区域

So edit your Virtual Host definition for this site and add因此,编辑此站点的虚拟主机定义并添加

Alias /ICallItThisInMyScript //192.168.1.134/path_here/

And also give access to that alias并且还可以访问该别名

<Directory //192.168.1.134/path_here/>
    Require all granted
</Directory>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用C#在远程Windows机器上创建共享文件夹? - How to create a shared folder on a remote Windows machine using C#? 如何使用 windows 10 中的另一个文件夹扩展文件夹,以使两个文件夹中的所有文件都可以从一个路径访问? - How to extend folder with another folder in windows 10, in such way that all files in both folders are accessible from one path? 在Windows 10上,授予用户创建,编辑和删除文件夹C:\\ VMs中的文件的权限,但禁止删除文件夹本身 - On Windows 10, grant a user rights to create, edit and delete files in the folder C:\VMs, but prevent deletion of the folder itself Emacs tramp在Linux上编辑Windows上的远程文件 - Emacs tramp to edit remote files on Windows from Linux 从共享文件夹Windows批处理中删除X个较早的文件 - Delete X olderdays Files from Shared Folder windows batch 如何从Linux中删除远程Windows中的文件夹 - How to delete a folder in remote Windows from Linux 如何在Windows 10 UWP上的工作文件夹中创建文件 - How to create files in working folder on Windows 10 UWP 如何从 Java 获取 Windows 10 上已安装应用程序的列表 - How to get the list of installed applications on Windows 10 from Java 如何从远程Windows服务器下载文件 - How to download files from remote windows server 在Windows环境中编辑文件夹白名单上的文件 - Edit files on folder whitelist in Windows environment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM