gpt4 book ai didi

php - 在elfinder中映射文件夹内的驱动器

转载 作者:行者123 更新时间:2023-12-01 03:37:47 25 4
gpt4 key购买 nike

  1. 这里我是在elfinder中映射D盘
  2. 我无法打开文件。

这是我的代码。

$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'D:/pdf/', // path to files (REQUIRED)
'URL' => 'D:/pdf/', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);

最佳答案

通常浏览器只会打开网址而不是路径。我们必须将路径转换为网址。

如果要映射驱动器(D 驱动器),请在 XAMMP 中创建虚拟目录。在httpd-vhosts.conf中添加以下代码

<VirtualHost *:80>
<Directory "D:/pdf">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
ServerAdmin anbu@local.dev
DocumentRoot "D:/pdf"
ServerName local.dev
</VirtualHost>

现在重新启动您的服务器。

修改下面代码中的url

$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'D:/pdf/', // path to files (REQUIRED)
'URL' => 'http://local.dev', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);

希望它能起作用:)

关于php - 在elfinder中映射文件夹内的驱动器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28891503/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com