Re: PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)
| From: | Rahul Sitaram Johari | Date: | Fri, 02 Nov 2007 14:55:26 +0000 |
| Subject: | Re: PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263977@lists.php.net to get a copy of this message | ||
On 11/2/07 8:26 AM, "Jason Pruim" <japruim@raoset.com> wrote:
>
> On Nov 1, 2007, at 5:54 PM, Jim Lucas wrote:
>> Sounds like a clear case of Apache being chroot'ed.
>>
>> This is based off the BSD style setup I believe. Which I believe
>> Mac uses, So, I would check your startup line for Apache. I did
>> some googling, but I could not find anything to confirm my thinking
>> that the Mac Apache configuration is anything like the default
>> OpenBSD setup.
>>
>> I know you can manually start httpd with the -u flag to disable
>> chrooting
>>
>> Again, I can't find any examples of the Mac setup, but my money
>> would be on chrooting as the problem.
>
>
> I have been a Mac user for my entire computing life, and although I
> can't tell you the difference between Apple's setup and OpenBSD's set
> up.. I can point you to a list that would definitely be able to help.
> which is:
> http://lists.apple.com/mailman/listinfo/macos-x-server
>
> That list as some of the most knowledgeable mac Heads I have ever
> dealt with, and they have helped me through all kinds of stuff.
>
> If anyone can tell you, they can.
>
That sounds like a good place to look.
I actually did figure out a way to make this work. It appears that Apache
Web Server did not have enough permissions to read files on a mounted share,
simply because Leopard eliminated the -u -g arguments for mount_smbfs - so
basically my guess was right on target.
I was able to figure out the workaround to mounting a share giving it
specific user/group:
Sudo -u www mount_smbfs -f 0777 -d 0777 //usr:pwd@ip/share node
That works!
It mounts the share as "www" - which is Apache Web Server - and my PHP
scripts had no problem reading files of the share on my Website.
Now I need to figure out how to write an AppleScript (or use the Automator)
to automate the process on every boot up. I had an AppleScript before to do
this - but it's changed now.
Thanks guys.
PS: You guys are funny! And brilliant!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.
W: http://www.rahulsjohari.com
E: sleepwalker@rahulsjohari.com
³I morti non sono piu soli ... The dead are no longer lonely²