Home >Backend Development >PHP Problem >where is php.ini
I recently installed the lamp environment in centos and found that after installing php, there is no php.ini file. So where is php.ini?
Normally the php.ini file is in the lib directory under the php installation directory. For example, my php installation directory is in /usr/ local/php/, but I couldn't find the php.ini configuration file in the /usr/local/php/lib directory. (Recommended study: PHP video tutorial)
I found some answers on the Internet, and finally came to the conclusion: If the php.ini file is not generated when compiling and installing php, you can do it through the php source code package Obtain.
Direct method:
1. Enter the php source code package directory, which is the directory where you downloaded the php source code package and decompressed it. We usually download the general source code package. My decompression directory in the /usr/src/ directory is: /usr/src/php-5.6.15/ Check all the files in this directory, and you will find that there are two files in it: php.ini-development and php.ini- production
2. Copy php.ini-development or php.ini-production to the lib folder /usr/local/php/lib in the PHP installation directory and rename it to php.ini. The command is as follows: cp php.ini-production /usr/local/php/lib php.ini
3. Finally switch to /usr/local/php/lib and you can see it php.ini file, and you’re done!
The above is the detailed content of where is php.ini. For more information, please follow other related articles on the PHP Chinese website!