Generally after Apache installs php, the default loading location of the php configuration file is in the php/lib/ folder. If there is no php.ini file in this folder, apache will not be able to find the php configuration file. There are two types of Method,
The first method: copy a configuration file of the same version of php to the default loading folder, then the configuration in the configuration file will be applied.
The second method: specify an existing php.ini location. The specific method is as follows:
(Add PHPiniDir /usr/local/lib/php.ini in the last line of the httpd.conf file)
As shown below:
The modified Apache configuration is as follows:
You can view it by accessing a php file that means output phpinfo ().
The above introduces how to modify the Apache configuration to specify the location of the php configuration file phpini, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.