# PHP can't access a file on a mounted Share



## mickey79 (Sep 13, 2006)

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!!


----------



## macworks (Sep 13, 2006)

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.


----------



## HateEternal (Sep 13, 2006)

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>


----------



## mickey79 (Sep 18, 2006)

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


----------

