Using Phpize to add extensions to PHP dynamically under Linux _php tutorial

Source: Internet
Author: User
Tags pear
The common use of PHP is: Compile php forget to add an extension, and then want to add extensions, but because the installation of PHP after installing some things such as pear, do not want to remove the directory reload, don't say, PHP really has such a 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 and built-in, Linux "This type of function is only available when PHP is configured with--enable-bcmath" (in quotation marks in the manual)

Fortunately there are phpize,

The method is to have PHP compression packages that are identical to the existing PHP. I'm using a php-5.2.6.tar.gz.

Expand into the inside of the Ext/bcmath directory

Then execute/usr/local/php/bin/phpize, which is an executable text file, to make sure it's in the system

Will find some configure files in the current directory,

If there is no error, then

PHP code

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

Be careful to make sure that/usr/local/php/bin/php-config exists first.

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

If there is no error, make, then make install, then it tells you a directory

You copy the bcmath.so in the directory to the directory in the Extension_dir point of your php.ini,

Modify PHP.ini, add a sentence at the end extension=bcmath.so

Restart Apache.

http://www.bkjia.com/PHPjc/508443.html www.bkjia.com true http://www.bkjia.com/PHPjc/508443.html techarticle the common problem with PHP is: Compile php forget to add an extension, and then want to add extensions, but because after installing PHP and then loaded with something such as pear, do not want to remove the directory reload, don't say, ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.