Bug #50374 [Com]: .user.ini subdirectory not working and problem with [PATH] in php.ini

From: Date: Tue, 17 Mar 2015 09:39:47 +0000
Subject: Bug #50374 [Com]: .user.ini subdirectory not working and problem with [PATH] in php.ini
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191424@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=50374&edit=1

 ID:                 50374
 Comment by:         framelio at gmail dot com
 Reported by:        tom_borgo at hotmail dot com
 Summary:            .user.ini subdirectory not working and problem with
                     [PATH] in php.ini
 Status:             Assigned
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   XP SP3
 PHP Version:        5.3.1
 Assigned To:        pajoye
 Block user comment: N
 Private report:     N

 New Comment:

I have the same problem here, with php 5.3.29, 5.4.38, 5.5.22 and 5.6.6 

Configuration on linux with Apache 2.4.12 and mod_proxy_fcgi and PHP-FPM configuration:

# This is to forward all PHP to php-fpm.
<FilesMatch \.php$>
 SetHandler "proxy:unix:/path/to/.socks/php-domain.sock|fcgi://domainname/"
</FilesMatch>

The .user.ini directives apply only in the same folder as the php file and not in the subfolders.

Some phpinfo:

Server API: FPM/FastCGI 
_SERVER["DOCUMENT_ROOT"] is correctly set to the virtualhost DocumentRoot

I didn't have this problem when working with mod_fastcgi using FastCgiExternalServer directive.


Previous Comments:
------------------------------------------------------------------------
[2014-09-13 13:08:27] dummy at dumyydummy dot com

Same problem on Win7 with apache 2.4.10 X86 (the one from apache haus and the one from Apache
Lounge) and php 5.6.0, php 5.5.16 or php 5.3.29 all in fcgi mode.

php configurations defined in .user.ini only apply to the folder where .user.ini is. Not subfolders.

------------------------------------------------------------------------
[2011-07-08 11:21:59] carsten_sttgt at gmx dot de

> /www/phpinfo.php -> take into account the /www/.user.ini
> /www/administrator/phpinfo.php -> take NOT into account the /www/.user.ini

Just found out: The same problem exists in PHP 5.3.6-NTS-VC9; Apache/2.2.19 (CGI setup); Windows 7
32bit

Even I can read in the manual:
| In addition to the main php.ini file, PHP scans for INI files in each
| directory, starting with the directory of the requested PHP file, and working
| its way up to the current document root

I have a DOCUMENT_ROOT = "D:\Webserver\Apache2.2\htdocs"
And the files:
D:\Webserver\Apache2.2\htdocs\.user.ini
D:\Webserver\Apache2.2\htdocs\phpinfo.php (working)
D:\Webserver\Apache2.2\htdocs\test\phpinfo.php (not working)

Regards,
Carsten

------------------------------------------------------------------------
[2010-06-13 20:56:31] tom_borgo at hotmail dot com

Thanks Pajoye for your fast answer.
I really hope you can fix it ! :)

Yes htscanner is an alternative solution, i never try it. I prefer rely on PHP itself. And htscanner
is in alpha stage and last release is more one year old, i mean for system in real production it is
necessary to have stable version. Htscanner seems ok for leisure purpose but I will not use it for
bussiness application.

------------------------------------------------------------------------
[2010-06-13 20:32:37] pajoye@php.net

Assigned means "someone (me) will work on it", not "it is fixed" :)

Btw, htscanner allows htaccess-like file for 5.x, for the record.

------------------------------------------------------------------------
[2010-06-13 20:19:49] tom_borgo at hotmail dot com

Hello,

Yes, the problem has not been resolved, or the documentation has not been updated to say that it is
normal that it doesn't affect the subdirectory.
It is a shame because .user.ini is very important to use php directive by directory (because
htaccess cannot be used in this way like PHP in apache module).

I hope problem will be taken really into consideration. And it is really easy to test it.

Thanks.
Thomas.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=50374


--
Edit this bug report at https://bugs.php.net/bug.php?id=50374&edit=1


Thread (18 messages)

« previous php.bugs (#191424) next »