This question has been tried by Baidu. google has failed to find a satisfactory answer many times. After installing php, print phpinfo () and a "LoadedConfigurationFile" option will be displayed. This option is used to load php. INI file, php. some extensions (such as red...
Google has not found a satisfactory answer to this question many times.
After installing php, print phpinfo () and a "Loaded Configuration File" option will be displayed,
This option is used to load the php. ini file. Some extensions (such as redis. so, phalcon. so, mcrypt. so...) may be loaded in the php. ini file .....)
I am using the Linux + Nginx (1.6.2) + Mysql + PHP (5.6.1) Environment, php installation directory:/usr/local/php5.6, php exists under/usr/local/php5.6/lib. INI file, but I did not load this INI file. According to the printed phpinfo information, the loaded INI file is/usr/local/lib/php. ini
Now the problem is coming. I want to load php. the INI file is/usr/local/php5.6/lib/php. ini instead of/usr/local/lib/php. ini, how can I customize the php. INI file.
Other php versions have been installed on the computer, but they are no longer used. The/etc/profile environment variable uses php5.6, which is newly installed. I have tried many ways to load the php. ini file in the Custom location (for example, setting the INI file environment variable and adding -- with-config-file-path when compiling php)
Back to the topic, how to customize the php. ini File path (that is, the File path in the Loaded Configuration File option in the printed phpinfo)
There are a lot of solutions for google. I read a lot of answers, but they are not what I want. Hurry up and make a move.
Reply content:
Google has not found a satisfactory answer to this question many times.
After installing php, print phpinfo () and a "Loaded Configuration File" option will be displayed,
This option is used to load the php. ini file. Some extensions (such as redis. so, phalcon. so, mcrypt. so...) may be loaded in the php. ini file .....)
I am using the Linux + Nginx (1.6.2) + Mysql + PHP (5.6.1) Environment, php installation directory:/usr/local/php5.6, php exists under/usr/local/php5.6/lib. INI file, but I did not load this INI file. According to the printed phpinfo information, the loaded INI file is/usr/local/lib/php. ini
Now the problem is coming. I want to load php. the INI file is/usr/local/php5.6/lib/php. ini instead of/usr/local/lib/php. ini, how can I customize the php. INI file.
Other php versions have been installed on the computer, but they are no longer used. The/etc/profile environment variable uses php5.6, which is newly installed. I have tried many ways to load the php. ini file in the Custom location (for example, setting the INI file environment variable and adding -- with-config-file-path when compiling php)
Back to the topic, how to customize the php. ini File path (that is, the File path in the Loaded Configuration File option in the printed phpinfo)
There are a lot of solutions for google. I read a lot of answers, but they are not what I want. Hurry up and make a move.
Both php and php-fpm can specify the directory of the php. ini file through the-c parameter:
Php-h and php-fpm-h visible
-c
|
Look for php.ini file in this directory
You can set the path through configure-related configuration items during compilation and installation. For details, see./configure -- help to view the php help documentation!
-- With-config-file-path =/usr/local/php5.6/lib/php. ini storage location
-- With-config-file-scan-dir =/usr/local/php5.6/lib/conf. d extension file directory
You can manually enable php-fpm to determine the location of the loaded php. ini php-fpm.conf by specifying the-c parameter, but the default location can only be specified by compiling the configure Parameter