php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6480 doc_root fails in safe_mode
Submitted: 2000-08-31 19:59 UTC Modified: 2000-10-31 09:26 UTC
From: gvillemure at ik dot ca Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.2 OS: RH6.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gvillemure at ik dot ca
New email:
PHP Version: OS:

 

 [2000-08-31 19:59 UTC] gvillemure at ik dot ca
Problem: doc_root fails in safe_mode with PHP4.0.2

If I set the following in my /usr/local/lib/php.ini

safe_mode  = On
doc_root   = /u/vhome

I get:
Warning: Unable to access /u/vhome/u/vhome/ik.ca/www/old/info.php3 in
Unknown on line 0
Warning: Failed opening '/u/vhome/ik.ca/www/old/info.php3' for inclusion
(include_path='.:/usr/local/lib/php') in Unknown on line 0

Notice in the first line the /u/vhome is there twice.

If I turn off safe_mode or remove doc_root then its fine.

Thanks,
Gerald Villemure

Some info:
System:  RH6.1

#PHP4.0.2
./configure --with-apache=../apache_1.3.12 --with-mysql  \
--with-imap=../imap-4.7c --with-ldap --with-zlib \
--enable-debug=no --enable-memory-limit=yes \
--enable-safe-mode --enable-track-vars

#Apache 1.3.12
./configure --prefix=/usr/local/apache --enable-module=ssl \
--activate module=src/modules/php4/libphp4.a \
--disable-module=userdir --disable-module=actions \
--enable-module=rewrite

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-03 05:48 UTC] stas@php.net
what are ownership/permissions on /u/vhome/u/vhome/ik.ca/www/old/ and /u/vhome/u/vhome/ik.ca/www/old/info.php3?
 [2000-09-03 06:15 UTC] gvillemure at ik dot ca
The path: /u/vhome/u/vhome/ik.ca/www/old/ dose not exist.

The real path is: /u/vhome/ik.ca/www/old/

The /u/vhome is where I am trying to set doc_root to but if I turn on safe_mode I get path the error.

The ownership/permissions in /old are:

drwxr-xr-x  29500:98 .
-rw-r--r--  29500:98 info.php3

The Apache server is running as user 98 group 98.

 [2000-09-03 09:37 UTC] sniper@php.net
bug report #6491 seems to be related to this one.

--Jani
 [2000-09-07 11:47 UTC] andi@php.net
Are you sure you're not doing
include "/u/vhome/ik.ca/www/old/info.php3"?
safe_mode and doc_root ALWAYS appends the doc_root to the filename as far as I know. It doesn't check that the include you're doing is actually under the doc_root. You should use relative pathnames and not full paths.
Anyway, let us know if we can close this bug.
 [2000-09-07 14:22 UTC] gvillemure at ik dot ca
The content of info.php3 is:
<?php
phpinfo();
?>

I am referring to the file directly with:
http://bkp.ik.ca/old/info.php3

Possibly relevant setting in php.ini:
safe_mode               = On
safe_mode_exec_dir      = /u/vhome/php3-safe
safe_mode_allowed_env_vars = PHP_
memory_limit            = 8388608
auto_prepend_file       =
auto_append_file        =
include_path            =
doc_root                = /u/vhome
user_dir                =
upload_max_filesize     = 20971520
extension_dir           = ./
enable_dl               = On

These setting are the same as what I use with 4.0.1pl2 and the problem dosen't come up...

Note that I have receive emails from other users stating they have the same problem.

 [2000-10-31 09:26 UTC] gvillemure at ik dot ca
I recently installed 4.0.3pl1 and the problem is no longer there.

G?rald
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Jun 27 17:00:01 2026 UTC