Home > Article > Backend Development > What to do if php.ini cannot be found
Solution to the problem that php.ini cannot be found: 1. Obtain the lib directory through the php source code package, which is in [/usr/local/php/]; 2. Enter the php source code package directory and copy the code to In the lib folder under the PHP installation directory, switch to [/usr/local/php/lib].
Solution to php.ini not found:
1. Under normal circumstances, 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 cannot find the php.ini configuration file in the /usr/local/php/lib directory. .
I searched for some answers on the Internet, and finally came to the conclusion: If the php.ini file is not generated when compiling and installing PHP, it can be obtained through the PHP source code package;
2. 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. Generally, we usually download the source code package to the /usr/src/
directory where I decompressed it. The directory is:/usr/src/php-5.6.15/Look at all the files in this directory, 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
Go to the lib folder in the php installation directory /usr/local/php/lib
and rename it For php.ini
, the command is:
cp php.ini-production /usr/local/php/lib php.ini
3. Finally switch to /usr/local/php/lib
You can see the php.ini file, and you're done!
Relevant learning recommendations: php graphic tutorial
The above is the detailed content of What to do if php.ini cannot be found. For more information, please follow other related articles on the PHP Chinese website!