Using Phpize to add extensions to PHP dynamically under Linux

Source: Internet
Author: User

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.

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 this is an executable text file, to make sure it is in the system (it is actually your current running PHP directory )

/usr/local/php/bin/phpize

Will find some configure files in the current plug-in directory,

If there is no error, then the PHP code (php-config to the actual path to your server)

./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_dir=/usr/lib/bcmath.so

Restart Apache.

Using Phpize to add extensions to PHP dynamically under Linux

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.