If the php version is 5.2.x
If it is a lamp environment, there will be a php-5.2.x folder after decompressing the php source file php-5.2.x.tar.gz.
Carry out in the php-5.2.x folder./configure --prefix=/opt/php5.2, make, make intall,
Then the php5.2 folder will be produced under /opt/ (this folder is required for runtime).
After successful installation, open the phpinfo file.
[php]
phpinfo();
phpinfo();
Attribute: Configuration File (php.ini) Path contains the path pointed to by php.ini.
However, when entering the path, I found that there is no php.ini file, so where is php.ini?
How to find it:
Exit the php5.2 folder to the upper-level directory, and then execute the following search command:
find ./ -name "php.ini*"
Find results: (my own environment)
./php-5.2.17/php.ini-recommended
./php-5.2.17/php.ini-dist
Oh, it turns out to be the folder after decompression of php-5.2.x!
cp ./php-5.2.17/php.ini-dist php5.2/
Restart Apache
Refresh the phpinfo file and you will find your php.ini file.
Loaded Configuration File:xxxxxxxxx