Home  >  Article  >  Backend Development  >  After compiling and installing PHP through the source code package php-5.4.9.tar.gz, how to load dynamic modules without reconfiguring PHP_PHP tutorial

After compiling and installing PHP through the source code package php-5.4.9.tar.gz, how to load dynamic modules without reconfiguring PHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-14 10:07:08702browse

First confirm: when we installed PHP, we specified its installation directory: --prefix=/var/lib/php5; and the directory /home/guanli/php-5.4.9 is after we decompressed .tar.gz The path, 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 message is displayed at this time:
Configuring for:
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 execution, we will automatically be prompted to add the bcmath.so module to the path: /var/lib/php5/lib/php/extensions/no-debug-non-zts-20100525

Next, set the extension directory in php.ini:

If the location of the configuration file is not specified when compiling PHP, the default php.ini should be placed under /var/lib/php5/lib before it can be loaded. This has been discussed elsewhere.

We find ; extension_dir = "./", cancel the previous comment and change it to:

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.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477896.htmlTechArticleFirst confirm: when we install PHP, we specify its installation directory: --prefix=/var/lib /php5; and the directory /home/guanli/php-5.4.9 is the path after we unzip the .tar.gz, which is the source code...
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