这是我的代码。
$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)
)
)
);
通常,浏览器只会打开url而不打开路径。我们必须将路径转换为url。
如果要映射驱动器(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 [email protected]
DocumentRoot "D:/pdf"
ServerName local.dev
</VirtualHost>
现在重新启动服务器。
修改打击代码中的网址
$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)
)
)
);
希望它能工作:)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句