简体   繁体   English

使用 OPENDIR 访问共享云端硬盘

[英]Access shared drive using OPENDIR

I want to display all the drives in my system through PHP, So i used opendir.我想通过 PHP 显示我系统中的所有驱动器,所以我使用了 opendir。 Here a problem i had already mapped a drive in the name of Z: this drive not showing while we try to displaying the drives in browser.这里有一个问题,我已经以 Z 的名义映射了一个驱动器:当我们尝试在浏览器中显示驱动器时,这个驱动器没有显示。

Basically i am having c: drive and additionally i have mapped the Z: drive from network connection.基本上我有 c: 驱动器,另外我已经从网络连接映射了 Z: 驱动器。 Please help me how to show both the drives in browser请帮助我如何在浏览器中显示两个驱动器

The default SYSTEM User under windows will not be able to access mapped network drives. windows 下的默认 SYSTEM 用户将无法访问映射的网络驱动器。 Services run under this user by default, like Apache.服务默认在此用户下运行,例如 Apache。

Mapped network drives are mounted for a specific user and won't work for other users.映射的网络驱动器是为特定用户安装的,不适用于其他用户。

Tips:提示:

  1. Instead of using the drive letter use the UNC path.不要使用驱动器号,而是使用 UNC 路径。 (example: '\\server\share instead' of 'g:\') (例如:'\\server\share 而不是'g:\')
  2. Mapped drive is mapped for some specific user, while service is running in another context and is not aware of this mapping.映射的驱动器是为某些特定用户映射的,而服务在另一个上下文中运行并且不知道此映射。 There is a privilege called "Log on as a service".有一种称为“作为服务登录”的特权。 The user account you specify for service should have this privilege.您为服务指定的用户帐户应具有此权限。 Use secpol.msc to grant it.使用 secpol.msc 授予它。
  3. Run the server from the local user to which the network drive is mapped, instead of running it as a system service.从网络驱动器映射到的本地用户运行服务器,而不是将其作为系统服务运行。 Use services.msc and change the user under the Logon tab.使用 services.msc 并在登录选项卡下更改用户。

Always do tip 1. Choose between tip 2 or 3.始终执行提示 1。在提示 2 或 3 之间进行选择。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM