PHP Dynamic Add extension

Source: Internet
Author: User

1. Locate the source code directory for the currently running PHP version, such as php-4.4.7. Enter the Curl Extension Library directory.
$CD/home/php-4.4.7/ext/curl

2. Call the Phpize program to generate the compilation configuration file.
$/usr/local/php4/bin/phpize

3. Compile the extension library and perform the following configure and make commands, respectively.
$./configure-with-php-config=/usr/local/php4/bin/php-config
# #configure这一步执行通过后, then execute the Make command, and if configure does not pass, find the cause of the error.
$make && make Install
# #make成功执行后, the resulting extension library file is in the modules subdirectory of the current directory,
such as/home/php-4.4.7/ext/curl/modules/curl.so

4. Configuring the php.ini File
# #将编译好的扩展库文件复制到apache2 the Modules directory. (Customizable directory)
$CP/home/php-4.4.7/ext/curl/modules/curl.so/usr/local/apache2/modules/.
# #可以通过查看phpinfo信息来确定php the. ini file location, and then edit.
# Locate the Settings extension directory #在php the. ini file, and then set the extension path to the Apache2 modules directory.
Extension_dir = "/usr/local/apache2/modules/"
# #在php The Add Extension library location for. INI, set the extension library to be added.
Extension=curl.so
# #以后如果还要添加别的扩展库的话, just compile the PHP extension library first and copy it to the Apache2 modules directory.
# #然后再在这个位置, add a row to append the compiled extension library file name.

5. Restart Apache and view the Phpinfo information to see the Curl Extension library you just added.

Add extensions to PHP dynamically

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.