Environment Linux + Apache2.4 + php5.6
Expected implementation: the File_get_contents () method of PHP can be used to directly access the files in the shared directory on the LAN
(Windows can be accessed directly without the need for configuration, but Linux cannot access it.) Currently 1. The method of mounting the disk solves 2. By calling Smbclient implementation. But do not want to use this method, just want to know can be implemented by configuring Apache. Online said can, configuration as follows, but I try not to, do not know what the problem, authority?)
I configured the following in 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
Trouble pointing, thank you!
Reply content:
Environment Linux + Apache2.4 + php5.6
Expected implementation: the File_get_contents () method of PHP can be used to directly access the files in the shared directory on the LAN
(Windows can be accessed directly without the need for configuration, but Linux cannot access it.) Currently 1. The method of mounting the disk solves 2. By calling Smbclient implementation. But do not want to use this method, just want to know can be implemented by configuring Apache. Online said can, configuration as follows, but I try not to, do not know what the problem, authority?)
I configured the following in 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
Trouble pointing, thank you!
You this is an external access, not a PHP access
Positive solutions See so
Http://stackoverflow.com/questions/5070545/php-read-file-contents-of-network-share-file
mount -t cifs //10.173.32.4/myshare /www/htdocs/myshare
And then
$data = file_get_contents('/www/htdocs/myshare/file.txt');