How PHP adds built-in extensions

Source: Internet
Author: User
Tags phpinfo xsl zts

when PHP is installed on the server. Need extra supplemental PHP how to extend? You don't need to install PHP again. With Phpize We can install the original PHP on the basis of the extension directly. This compilation simply compiles the PHP extension library separately. The next step is to compile the extension libraryadded to the PHP now running, not the correct now running PHP again compiled, so there is no impact.
Below we demonstrate the extension of installing XSL (not necessarily used frequently.) Only as an example)procedure One:1. Locate the source folder for the currently running PHP version number, such as php-5.2.3.

Go to the XSL Extensions Library folder.

$CD/home/pkgs/php-5.3.3/ext/xsl
2. Call the Phpize program to generate the compilation configuration file.

$/home/app/php5.3.3/bin/phpize

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqveglmzwlqawfu/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>
3. Compile the extension library. Run the following configure and make commands, respectively. $./configure-with-php-config=/home/app/php5.3.3/bin/php-config This step after running through. Run the make command again. Assuming the Configure run does not pass, find the cause of the error.

$make #make成功运行后, the resulting extension library file is under the Modules subfolder of the current folder, such as/home/php-5.3.3/ext/curl/modules/xsl.so
4. Configuring the php.ini file #将编译好的扩展库文件拷贝到PHP的扩展文件夹下, you can view phpinfo information by:

$ cp/home/pkg/php-5.3.3/ext/xsl/modules/xsl.so/home/app/php5.3.3/lib/php/extensions/no-debug-non-zts-20090626

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqveglmzwlqawfu/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/> #在php. ini file to find the location of the Settings extension folder, and then set the extension path to the PHP installation folder/extension/no-debug-non .... Folder. and add the extension library location. extension_dir /home/app/php5.3.3/lib/php/extensions/no-debug-non-zts-20090626" Extension=xsl.so

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqveglmzwlqawfu/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>5. Restart PHP and view the phpinfo information to see the XSL extension library that you just added. (assuming there are multiple PHP-FPM processes, smooth restart of the main process can be: KILL-USR2 pid)

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqveglmzwlqawfu/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

How PHP adds built-in extensions

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.