Method: First use the "phpinfo()" function to view the PHP configuration details; then find the source code location based on the PHP configuration information; finally use the "cp" command to copy the configuration file in the source code to the PHP installation directory. bin and rename it to php.ini.
The operating environment of this tutorial: centos7 system, php7.0.13 version, thinkpad t480 computer
cannot be found after installing php under centos php.ini, and then check phpinfo(), it shows that it is under usr/local/php/bin, but it is not there after I checked. At this time, you need to copy one in your php source code.
My php source code is under /usr/local/src/php
There are two php configuration files in the source code
One is development mode and the other is production mode, depending on your needs. Directly copy the file to bin in the PHP installation directory and rename it to php.ini
# cp /usr/local/src/php/php-7.0.13/php.ini-development /usr/local/php/lib/php.ini
Recommended: "2021 PHP Interview Questions Summary (Collection)》《php video tutorial》
The above is the detailed content of What should I do if php.ini is not found when installing php7?. For more information, please follow other related articles on the PHP Chinese website!