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

From: Date: Fri, 02 Nov 2007 12:26:44 +0000
Subject: Re: PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-263965@lists.php.net to get a copy of this message
On Nov 1, 2007, at 5:54 PM, Jim Lucas wrote:
Rahul Sitaram Johari wrote:
Ave, Somehow my PHP won't access, won't even acknowledge the existence of a file that is outside the /Library/WebServer/Documents folder. This was never a a problem before in any Mac version - it just started with Leopard. I don't know what has changed where, in httpd.conf or php.ini or somewhere else, but something changed that's crippling access to files outside of the webserver. This Works in Mac OS X 10.3.9 (i.e., prints File Exists) but the same exact script does not work in Mac OS X 10.5, and yes, the file is available in Leopard in the mentioned location - path is exact same - permissions are all set: $filename = "/Users/username/Documents/Transfers/test.txt"; if (file_exists($filename)) { echo "The file $filename exists<br><br>"; } else { echo "The file $filename does not exist<br><br>"; } I¹ve already checked safe_mode which is Off and open_basedir which is not set same settings as php.ini from before. Any ideas what might be causing this? Thanks! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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²
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. -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com

« previous php.general (#263965) next »