# open_basedir Issue

- Thread: https://externals.io/message/18911
- Original archive: https://news-web.php.net/php.internals/18911
- Started by Aaron Greenspan on 2005-09-14T15:51:33+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #18911 — Aaron Greenspan — 2005-09-14T15:51:33+00:00

URL: https://externals.io/message/18911#18911

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

---

## #18917 — Sara Golemon — 2005-09-14T17:51:36+00:00

URL: https://externals.io/message/18911#18917 · In reply to: #18911

> 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');
?

---

## #18920 — Aaron Greenspan — 2005-09-14T18:37:07+00:00

URL: https://externals.io/message/18911#18920 · In reply to: #18917

Sara,

The output is:

/home/sites/site66/web/index.html

Thanks,

Aaron

Aaron Greenspan
President & CEO
Think Computer Corporation

http://www.thinkcomputer.com

---

## #18922 — Antony Dovgal — 2005-09-14T19:01:20+00:00

URL: https://externals.io/message/18911#18922 · In reply to: #18920

> 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

---

## #18923 — Aaron Greenspan — 2005-09-14T19:10:51+00:00

URL: https://externals.io/message/18911#18923 · In reply to: #18922

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

---

## #18924 — Sander Steffann — 2005-09-14T19:25:32+00:00

URL: https://externals.io/message/18911#18924 · In reply to: #18911

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.

---

## #18925 — Aaron Greenspan — 2005-09-14T19:35:53+00:00

URL: https://externals.io/message/18911#18925 · In reply to: #18924

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
