Bug #50374 [Asn->Opn]: .user.ini subdirectory not working and problem with [PATH] in php.ini

From: Date: Tue, 24 Oct 2017 07:31:50 +0000
Subject: Bug #50374 [Asn->Opn]: .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-212090@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
 Updated by:         kalle@php.net
 Reported by:        tom_borgo at hotmail dot com
 Summary:            .user.ini subdirectory not working and problem with
                     [PATH] in php.ini
-Status:             Assigned
+Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   XP SP3
 PHP Version:        5.3.1
-Assigned To:        pajoye
+Assigned To:        
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2017-01-13 09:00:54] kawewong at gmail dot com

I have the same problem.

If I put .user.ini file into www root.
http://localhost/ -> ini_get('upload_max_filesize')
result is 10M (override value)
http://localhost/test ->
ini_get('upload_max_filesize') result is 10M
http://localhost/test/lv2 ->
ini_get('upload_max_filesize') result is 10M
http://localhost/test/lv2/lv3 ->
ini_get('upload_max_filesize') result becomes 2M which is php.ini value and this folder
has no .user.ini file.
These are not in virtual directory.

------------------------------------------------------------------------
[2015-03-17 09:39:46] framelio at gmail dot com

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.

------------------------------------------------------------------------
[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.

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


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 (#212090) next »