PHP can't access a file on a mounted Share

mickey79

True Defiance
Ave,

Here's the problem.
My Mac OS X is connected to a Windows 2003 Server. There is a Shared Folder on that server and the Mac OS X User has Full Permissions over that folder. That folder is Mounted on my Mac OS X using SMB.

The Mac OS X has an apache web server, php and hosts my websites. I have a PHP script that wants to read a file on that mounted share... but it doesn't seem to work. First of all, what's the Path i need to use. What i'm using is "/Volumes/Server/filename" .... which is what the "pwd" command in the Teminal Window tells me when i go to that location in the terminal window.

The whole of my Mac OS X, including Terminal and all are able to access that mounted share... modify, create files on that share... and do whatever they please.... Why can't my PHP view and read that file then?

I used opendir() to view contents of the /Volumes/Server folder but it shows nothing. It's like PHP can't access a mounted Share... but the rest of the Mac OS X can!!

Any suggestions!!
 
I would look closer at the permissions on the Windows server. PHP is trying to access files as the WWW user on your system, so make sure the Windows share will allow the "www" user to read and write files.
 
By default OS X mounts the share so only the user mounting it has access. Because the apache user is the one actually executing the PHP script it doesn't have access to it.

Add privileges to the 'other' permission level for the mount point of the share.

Something kinda like

chmod -R o+r /Volumes/<share>
 
Ave,

I used:

mount -t smbfs //UserName@Domain/Share SharePoint

in the terminal window. SharePoint being a folder i created in my home directory. Everything works uber now!

Mickey
 
Back
Top