Home > Backend Development > PHP Tutorial > Use phpize to dynamically add extensions to PHP under Linux_PHP tutorial

Use phpize to dynamically add extensions to PHP under Linux_PHP tutorial

WBOY
Release: 2016-07-13 17:34:36
Original
715 people have browsed it

A common problem when using PHP is: I forgot to add an extension when compiling PHP. I want to add the extension later, but because I installed some things such as PEAR after installing PHP, I don’t want to delete the directory and reinstall it. Don’t tell me, PHP is really like this. function.

I didn’t see it in the manual.

If I want to add bcmath support, this is an extension that supports large integer calculations. Windows comes with it and is built-in. Linux "This type of function is only available when --enable-bcmath is configured when PHP is compiled" (the quotes are from the manual)

Fortunately, there is phpize,

The method is to have a php compressed package that is exactly the same as the existing php. I'm using php-5.2.6.tar.gz.

Expand and enter the ext/bcmath directory inside

Then execute /usr/local/php/bin/phpize, which is an executable text file. Make sure it is in the system

You will find that there are some more configure files in the current directory,

If no error is reported, then

Php code

 ./configure --with-php-config=/usr/local/php/bin/php-config

Note that you must first ensure that /usr/local/php/bin/php-config exists.

If your PHP installation path is not the default, you need to change it.

If no error is reported, make, then make install, and then it will tell you a directory

You copy bcmath.so in this directory to the directory pointed to by extension_dir in your php.ini,

Modify php.ini and add extension=bcmath.so at the end

Restart apache.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/508443.htmlTechArticleA common problem when using php is: you forget to add an extension when compiling php, and then you want to add the extension, but because of the installation of php Later, I installed some things such as PEAR, etc. I don’t want to delete the directory and reinstall, don’t say...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template