环境 Linux + Apache2.4 + php5.6
期望实现:可以通过php的file_get_contents()方法直接访问局域网内共享目录的文件
(windows下可以直接访问不需要配置,但linux下访问不了。目前可以 1.通过挂载磁盘的方法解决 2.通过调用smbclient实现。 但是不想用这个方法,就想知道能不能通过配置Apache实现。网上说可以,配置如下,但是我试了不可以,不知道有什么问题,权限?)
我在 http-vhosts.conf配置了如下
Servername 127.0.0.1
DirectoryIndex index.php
Documentroot /www/htdocs/
Alias /myshare "//10.173.32.4/myshare"
AllowOverride None
Order allow,deny
Allow from all
麻烦指点一下,谢谢!
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
业精于勤,荒于嬉;行成于思,毁于随。