open_basedir Issue

php.internals

Aaron Greenspan

20 years ago
Hello, Can someone tell me what I'm doing wrong here? I'm using PHP 4.3.11 on Red Hat 5.0 (Cobalt). /home/sites/www.harvardchemclub.org is a symbolic link that points to /home/sites/site66. I've tried this with and without trailing slashes. I added a comment to a similar bug report years ago, which I believe has gone largely ignored, and now my comment seems to have disappeared. Anyway, here's the error: --- Warning: fopen(): open_basedir restriction in effect. File(/home/sites/www.harvardchemclub.org/web/index.html) is not within the allowed path(s): (/home/sites/site66:/home/sites/www.harvardchemclub.org:/home/think/lampshade:/home/think/whiteboard:/home/think/mail:/home/think/phpmyadmin) in /home/think/whiteboard/shared/shared.inc.php on line 565 --- Thanks, Aaron Aaron Greenspan President & CEO Think Computer Corporation http://www.thinkcomputer.com

Sara Golemon

20 years ago
> Can someone tell me what I'm doing wrong here? I'm using PHP 4.3.11 on > Red Hat 5.0 (Cobalt). /home/sites/www.harvardchemclub.org is a symbolic > link that points to /home/sites/site66. I've tried this with and without > trailing slashes. I added a comment to a similar bug report years ago, > which I believe has gone largely ignored, and now my comment seems to > have disappeared. >
What is the output of: <?php echo realpath('/home/sites/www.harvardchemclub.org/web/index.html'); ?>

Aaron Greenspan

20 years ago
Sara, The output is: /home/sites/site66/web/index.html Thanks, Aaron Aaron Greenspan President & CEO Think Computer Corporation http://www.thinkcomputer.com

Antony Dovgal

20 years ago
On 14.09.2005 22:37, Aaron Greenspan wrote:
> Sara, > > The output is: > > /home/sites/site66/web/index.html
I guess this is the answer: "All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink." (c) http://www.php.net/manual/en/features.safe-mode.php#ini.open-basedir
-- Wbr, Antony Dovgal

Aaron Greenspan

20 years ago
Antony, I'm not trying to avoid the restriction by using a symbolic link. I'm trying to enforce it, yet regardless of whether I put any of the following in my allowed path: /home/sites/site66 /home/sites/site66/ /home/sites/site66/web /home/sites/site66/web/ /home/sites/www.harvardchemclub.org /home/sites/www.harvardchemclub.org/ /home/sites/www.harvardchemclub.org/web /home/sites/www.harvardchemclub.org/web/ ...or any combination thereof, I am disallowed access to my files with the aforementioned error. I think this is a bug. Aaron Aaron Greenspan President & CEO Think Computer Corporation http://www.thinkcomputer.com

Sander Steffann

20 years ago
Hi,
> Can someone tell me what I'm doing wrong here? I'm using PHP 4.3.11 on Red > Hat 5.0 (Cobalt). > > /home/sites/www.harvardchemclub.org is a symbolic link that points to > /home/sites/site66. > > [...] > > [Reformatted for readability:] > Warning: fopen(): open_basedir restriction in effect. > File(/home/sites/www.harvardchemclub.org/web/index.html) is not within the > allowed path(s): > /home/sites/site66 > /home/sites/www.harvardchemclub.org > /home/think/lampshade > /home/think/whiteboard > /home/think/mail > /home/think/phpmyadmin > in /home/think/whiteboard/shared/shared.inc.php on line 565
With the information you have given I think this *should* work. This is a VERY old platform to run on. Any chance you can try this on more recent OS release? - Sander.

Aaron Greenspan

20 years ago
Sander, Unfortunately, I can't switch the OS, and frankly, I shouldn't have to. This is a Cobalt RaQ 4i. Love them or hate them, there are thousands of these machines out there--and they're all running PHP. If this is an OS problem, and it doesn't work for me, then it's unlikely to work for anyone (which is a lot of people). I may be mistaken about the precise version number from my previous post. Here's the output of uname -a: [root web]# uname -a Linux kermit.thinkcomputer.com 2.2.16C37_III #1 Sat Apr 12 14:54:32 PDT 2003 i586 unknown ...and the first line of /var/log/dmesg: Linux version 2.2.16C37_III (root@kbuild.sfbay.sun.com) (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #1 Sat Apr 12 14:54:32 PDT 2003 Thanks for your help, Aaron Aaron Greenspan President & CEO Think Computer Corporation http://www.thinkcomputer.com