# open_basedir .htaccess relative path problem - BUG or Expected?

- Thread: https://externals.io/message/42574
- Original archive: https://news-web.php.net/php.internals/42574
- Started by Nathan Rixham on 2009-01-12T12:21:05+00:00
- Messages: 5
- 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

---

## #42574 — Nathan Rixham — 2009-01-12T12:21:05+00:00

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

Hi All,

Figured this was for internals before opening up a bug report.

In php 5.2.8 on windows and linux (only ones tested so far)

when you add in a value to open_basedir in either php.ini or a 
vhosts.conf file; *relative* paths suddenly do not work for the 
php_value error_log specified in a .htaccess file.

thus:

with php.ini/vhosts.conf open_basedir NOT set

these values in .htaccess WILL work
php_flag log_errors on
php_value error_log logfile.txt

these values in vhosts.conf WILL work
php_flag log_errors on
php_value error_log logfile.txt

===========

with php.ini/vhosts.conf open_basedir set

these values in .htaccess WILL NOT work
php_flag log_errors on
php_value error_log logfile.txt

these values in vhosts.conf WILL work
php_flag log_errors on
php_value error_log logfile.txt

============

absolute paths to the same file always work.

can anybody confirm if this is a big or not before I submit?

regards,

Nathan

---

## #42575 — Nathan Rixham — 2009-01-12T12:29:02+00:00

URL: https://externals.io/message/42574#42575 · In reply to: #42574

Nathan Rixham wrote:
> Hi All,
> 
> Figured this was for internals before opening up a bug report.
> 
> In php 5.2.8 on windows and linux (only ones tested so far)
> 
> when you add in a value to open_basedir in either php.ini or a 
> vhosts.conf file; *relative* paths suddenly do not work for the 
> php_value error_log specified in a .htaccess file.
> 
> thus:
> 
> with php.ini/vhosts.conf open_basedir NOT set
> 
> these values in .htaccess WILL work
> php_flag log_errors on
> php_value error_log logfile.txt
> 
> these values in vhosts.conf WILL work
> php_flag log_errors on
> php_value error_log logfile.txt
> 
> ===========
> 
> with php.ini/vhosts.conf open_basedir set
> 
> these values in .htaccess WILL NOT work
> php_flag log_errors on
> php_value error_log logfile.txt
> 
> these values in vhosts.conf WILL work
> php_flag log_errors on
> php_value error_log logfile.txt
> 
> ============
> 
> absolute paths to the same file always work.
> 
> can anybody confirm if this is a big or not before I submit?
> 
> regards,
> 
> Nathan

please ignore the "php_flag log_errors on" it always works, included as 
it was in my test code - don't want to confuse matters.

also the bug? appears not to be in 5.2.6 - thus 5.2.8 specific

---

## #42576 — Jani Taskinen — 2009-01-12T12:38:44+00:00

URL: https://externals.io/message/42574#42576 · In reply to: #42575

Nathan Rixham wrote:
> > […]
> 
> please ignore the "php_flag log_errors on" it always works, included as 
> it was in my test code - don't want to confuse matters.
> 
> also the bug? appears not to be in 5.2.6 - thus 5.2.8 specific

What exactly IS the open_basedir setting value here?
Did you leave . out of it..?

--Jani

---

## #42577 — Nathan Rixham — 2009-01-12T12:58:18+00:00

URL: https://externals.io/message/42574#42577 · In reply to: #42576

Jani Taskinen wrote:
> Nathan Rixham wrote:
> > […]
> 
> What exactly IS the open_basedir setting value here?
> Did you leave . out of it..?
> 
> --Jani
> 

when open_basedir is set to the correct value (in this specific case set 
to the site root directory) eg /var/sites/testsite/ and the full path to 
the log file is /var/sites/testsite/logfile.txt

---

## #42578 — Nathan Rixham — 2009-01-12T13:01:15+00:00

URL: https://externals.io/message/42574#42578 · In reply to: #42577

Nathan Rixham wrote:
> Jani Taskinen wrote:
> > […]
> 
> when open_basedir is set to the correct value (in this specific case set 
> to the site root directory) eg /var/sites/testsite/ and the full path to 
> the log file is /var/sites/testsite/logfile.txt

just a quick one; it's def not a path error; the same config works using 
vhosts rather than .htaccess; and works completely using htaccess / 
vhosts on 5.2.6
