PHP post-compilation dynamic expansion module

Source: Internet
Author: User

No need to recompile PHP, you can dynamically extend the PHP module

Here is an example of extending mysqli:

1. Install the dependent packages required for phpize
# yum install m4 autoconf
2. Generate configure for compiled mysqli
进入PHP源码目录中扩展模块目录ext# cd /app/httpd/php-5.6.34/ext/mysqli#/usr/local/php/bin/phpizeConfiguring for:PHP Api Version:         20131106Zend Module Api No:      20131226Zend Extension Api No:   220131226
3. Check the current PHP extension directory
# /usr/local/php/bin/php-config --extension-dir/usr/local/php-5.6.34/lib/php/extensions/no-debug-non-zts-20131226
4. Compiling mysqli
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config#make && make install cleanInstalling shared extensions:     /usr/local/php-5.6.34/lib/php/extensions/no-debug-non-zts-20131226/Installing header files:           /usr/local/php-5.6.34/include/php/
5. Check
#ll /usr/local/php-5.6.34/lib/php/extensions/no-debug-non-zts-20131226/-rwxr-xr-x 1 root root  715322 Mar  5 16:11 mysqli.so
6. Add Enable Mysqli
#vim /etc/php.ini找到[MySQLi]配置块添加extension=mysqli.so
7. Restart PHP

PHP post-compilation dynamic expansion module

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.