Home  >  Article  >  Operation and Maintenance  >  centos cannot find php.ini file

centos cannot find php.ini file

王林
王林Original
2020-03-17 13:10:543170browse

centos cannot find php.ini file

centos6.5 cannot find php.ini after compiling and installing php. Even if it finds / -name php.ini, it cannot be queried.

The solution is as follows:

Execute a php script, write phpinfo() in the script to view the directory where php.ini is located.

(Recommended tutorial: centos usage tutorial)

Don’t worry if there is no php.ini in the directory. Go to the original php source code directory to view php.ini-development or php .ini-production;

Choose to rename that file to php.ini in the current environment;

And also copy the php.ini file to the directory where php.ini is located in phpinfo() Just hit it.

The best way is to configure the php.ini configuration during installation, such as: ./configure=/opt/local/php5.5 --with-config-file-path=/etc, like this The directory of php.ini is etc in the root directory. In fact, after make install php, php.ini needs to be manually copied to the /etc directory.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of centos cannot find php.ini file. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn