iridys Posted October 5, 2010 Share Posted October 5, 2010 My setup: (everything on a local network) Web server: Ubuntu Server 8.10 -- Workgroup File server: Windows Server 2008 x64 -- domain Test server: Win 2000 running WAMP -- domain I'm trying to run the code snippet below. $file is a file on the File server above. It definitely exists. Running the code below on the Test server works perfectly. But the file cannot be found when running from the Web server. $file = '//server/share/file.txt';if (file_exists($file))echo 'yay!';elseecho 'error'; What with the safe mode considerations, I've also tried to add: ini_set('safe_mode', 'Off'); to no effect. And since file, and fopen similarly not work, I'm pretty sure it's not that either. The File & Test servers are on the same Windows domain, but that's definitely not the reason. I tried the code on a file on a Linux computer in the Workgroup (where the Web server is) with the same results: Test server works, Web server does not. Please advise; I'm really lost. Quote Link to comment Share on other sites More sharing options...
thehippy Posted October 5, 2010 Share Posted October 5, 2010 Network shares use this format: \\smbserver\share\path\to\sharefile.ext http://php.net/manual/en/wrappers.file.php Windows Filesystem would probably resolve it correctly, but a nix box won't. Quote Link to comment Share on other sites More sharing options...
iridys Posted October 5, 2010 Author Share Posted October 5, 2010 Network shares use this format: \\smbserver\share\path\to\sharefile.ext http://php.net/manual/en/wrappers.file.php Windows Filesystem would probably resolve it correctly, but a nix box won't. I've tried both "\" and "/". No joy either way. Incidentally, if it's of any significance, the code works on my Test server (Win2k) only if I use "/". Quote Link to comment Share on other sites More sharing options...
thehippy Posted October 8, 2010 Share Posted October 8, 2010 I was positive I'd tried this myself when I was using nix as a desktop OS. Anyway, I'm questioning if a Linux PHP binary would support a windows share, does PHP have an internal library for it, might it use samba libs or others, does it need to be compiled with support? I didn't find any quick answers, damn you google!.. and PHP docs.. Try mounting the share and accessing it with a regular nix path, that'll most likely work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.