php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67944 open_basedir restriction in effect
Submitted: 2014-09-01 16:01 UTC Modified: 2014-09-10 15:56 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: php-fpm1 at gmail dot com Assigned:
Status: Closed Package: htscanner (PECL)
PHP Version: 5.4.32 OS: CentOS6
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: php-fpm1 at gmail dot com
New email:
PHP Version: OS:

 

 [2014-09-01 16:01 UTC] php-fpm1 at gmail dot com
Description:
------------
If running any PHP script, it tries to find .htaccess in / and /home/, while open_basedir doesn't allow to access these directories. Setting default_docroot in php-fpm configuration file doesn't help and it still errors like:
[Mon Sep 01 17:55:22.960430 2014] [proxy_fcgi:error] [pid 636259:tid 139855690389248] [client 127.0.0.1:63308] AH01071: Got error 'PHP message: PHP Warning:  Unknown: open_basedir restriction in effect. File(/.htaccess) is not within the allowed path(s): (/home/admin/:/tmp/:/var/tmp/:/usr/local/php54/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/lib/php/) in Unknown on line 0\nPHP message: PHP Warning:  Unknown: open_basedir restriction in effect. File(//.htaccess) is not within the allowed path(s): (/home/admin/:/tmp/:/var/tmp/:/usr/local/php54/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/lib/php/) in Unknown on line 0\nPHP message: PHP Warning:  Unknown: open_basedir restriction in effect. File(//home/.htaccess) is not within the allowed path(s): (/home/admin/:/tmp/:/var/tmp/:/usr/local/php54/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/lib/php/) in Unknown on line 0\n'

It should check if it has any privileges to access the directory, if it does not - skip it. Script was run from /home/admin/, .htaccess from there works without any problems.

Expected result:
----------------
No errors about open_basedir restriction.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-01 20:28 UTC] florian at margaine dot com
How come PHP even has to read the .htaccess file? Only apache does that afaik. Do you have something uncommon? Either way, it sounds like *something* is trying to have PHP read .htaccess files in different paths.
 [2014-09-01 20:34 UTC] florian at margaine dot com
Disregard my previous comment -- I didn't see the package on which this bug was attached.
 [2014-09-09 21:42 UTC] phpfpm1 at gmail dot com
Yes, it is htscanner extension related, it scans for .htaccess files recursively, so this way PHP itself could read php_value / php_flag from .htaccess files and not depend  on Apache/mod_php at all.
 [2014-09-10 15:55 UTC] phpfpm1 at gmail dot com
That was caused by https://bugs.php.net/bug.php?id=67998. So, not htscanner related.
 [2014-09-10 15:56 UTC] php-fpm1 at gmail dot com
-Status: Open +Status: Closed
 [2014-09-10 15:56 UTC] php-fpm1 at gmail dot com
Related to https://bugs.php.net/bug.php?id=67998
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC