Wamp scan additional php.ini

Does anyone know how to configure wampserver on localhost to scan the php.ini file in the root directory?

I can do this on my remote server without problems, it just works. But I can't figure out how to make localhost behave the same.

EDIT (again): I have three different websites at different stages of development on my localhost. I would like to put the php.ini file in the root directory of a specific website, and these changes will affect this website. On my remote server, it works as expected. But on wampserver I can't get it to work. Wamp will not read the php.ini file in the root directory or anywhere else, I placed it.

QUESTION: Why don't you scan all the folders in the tree for php.ini files? I thought this was standard unless otherwise specified.

+4
source share
3 answers

From http://php.net/manual/en/configuration.file.per-user.php :

.user.ini

Starting with PHP 5.3.0, PHP includes INI support for .htaccess style files for each directory. These files are processed only by CGI / FastCGI SAPI. This feature is deprecated by the hccanner PECL extension. If you are using Apache, use .htaccess files for the same effect.

In addition to the main php.ini file, PHP scans the INI files in each directory, starting from the directory of the requested PHP file and laying the path to the current document root (as set in $ _SERVER ['DOCUMENT_ROOT']). If the PHP file is outside the document root, only its directory is checked.

Only INI settings with the PHP_INI_PERDIR and PHP_INI_USER modes will be recognized in INI files of the .user.ini type.

Two new INI directives, user_ini.filename and user_ini.cache_ttl control the use of custom INI files.

user_ini.filename sets the name of the file that PHP searches in each directory; if it is set to an empty string, PHP does not scan at all. The default is .user.ini.

user_ini.cache_ttl determines how often user INI files are re-read. The default value is 300 seconds (5 minutes).

0
source

Two possibilities are possible (maybe the third, but I do not care now). Each of them has its own shortcomings. At least for my purpose.
1) As the "rkosegi" .user.ini files answered: http://php.net/manual/en/configuration.file.per-user.php
2) ini.sections: http://us3.php.net/manual/en/ini.sections.php

My solution is to reset AND / OR update wampserver php.ini as needed for every website being developed.

0
source

Source: https://habr.com/ru/post/1435619/


All Articles