Re: PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/2/07 11:12 AM, "Daniel Brown" <parasane@xxxxxxxxx> wrote:

> On 11/2/07, Rahul Sitaram Johari <sleepwalker@xxxxxxxxxxxxxxxx> wrote:
>> 
>> 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,
> 
>     I believe all of the modern MacOS variants still use the
> *nix-style (due to being based on BSD) rc.d startups, right?  If so:
> 
>     sudo echo "sudo -u www mount_smbfs -f 0777 -d 0777
> //usr:pwd@ip/share node" > /etc/rc.d/init.d/winsharemount
>     sudo chmod 755 /etc/rc.d/init.d/windsharemount
>     sudo ln -s /etc/rc.d/init.d/winsharemount /etc/rc.d/rc3.d/S74winsharemount
>     sudo ln -s /etc/rc.d/init.d/winsharemount /etc/rc.d/rc5.d/S74winsharemount
> 
>     That should help automate it on startup in single-user and
> multi-user mode (rc3 and rc5, respectively).

WOW! You are a Rock Star!
I haven't tried it out on my machine but looks promising - and yes - I do
agree that Mac's being based on the BSD are after all *nix at the core, I'm
pretty positive that should work.

Thanks! I'll post back.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: sleepwalker@xxxxxxxxxxxxxxxx

³I morti non sono piu soli ... The dead are no longer lonely²

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux