First, make sure that the installation directory -- prefix/var/lib/php5 is specified during PHP installation, and the directory/home/guanli/php-5.4.9is the path after we decompress .tar.gz, that is, the source code path. For example, install the bcmath Module # cd/home/g... Synta
First confirm: When we install PHP, specify its installation directory: -- prefix =/var/lib/php5; and directory/home/guanli/php-5.4.9 is the path after we decompress .tar.gz, that is, the source code path.
For example, install the bcmath module.
# Cd/home/guanli/php-5.4.9/ext
# Cd openssl
# Mv vonfig0.m4 config. m4
# Cd-
# Cd bcmath
#/Var/lib/php5/bin/phpize
An error is prompted:
Processing ING:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Cannot find autoconf. Please check your autoconf installation and the $ PHP_AUTOCONF environment variable. Then, rerun this script.
# Yum install autoconf
#/Var/lib/php5/bin/phpize
#./Configure -- with-php-config =/var/lib/php5/bin/php-config
# Make
# Make test
# Make install
After the execution, the system will automatically prompt us to add the bcmath. so module to the path:/var/lib/php5/lib/php/extensions/no-debug-non-zts-20100525 below
Next, set the extension directory in php. ini:
If the location of the configuration file is not specified during PHP compilation, the default php. ini should be placed under/var/lib/php5/lib to be loaded. it has been mentioned elsewhere.
We found; extension_dir = "./", removed the preceding comment, and changed it:
Extension_dir = "/var/lib/php5/lib/php/extensions/no-debug-non-zts-20100525"
Add extension module reference again
Extension = bcmath. so
At this point, restart the httpd service and verify through phpinfo () that the bcmath module has been successfully loaded.