Linux Learning Summary (38) Lamp's PHP expansion module installation

Source: Internet
Author: User
Tags php source code

The PHP dynamic module is a visible file that ends with. So and can be loaded as needed. The static module starts with PHP and does not see the file. Once PHP is compiled, if you want to add a function module again, either recompile PHP, or compile an extension directly, and then configure it in php.ini to be loaded and used.
/usr/local/php/bin/php -m //查看模块
Install a Redis module below

 cd /usr/local/src/ wget https://codeload.github.com/phpredis/phpredis/zip/develop  


At this point, we look at the path of the installed extension module.
ls/usr/local/php/lib/php/extensions/no-debug-zts-20131226

At this point we execute/usr/local/php/bin/php-m |grep Redis will find that the module has not been loaded, edit php.ini, join the module
Vim/usr/local/php/etc/php.ini//Add a line configuration (can be placed on the last line of the file)
Extension = redis.so
View/usr/local/php/bin/php-m |grep Redis again

Above we downloaded an extension module from the Internet, in addition we can also find some of the available modules, in the PHP source code package has an EXT directory, there are many extension modules

These modules can also be used to compile and install when we need them. The exact operation is exactly the same as above.

现在我们总结下整个安装过程1 进入扩展包文件下,当然如果是压缩文件,先解压2 执行/usr/local/php/bin/phpize 生成configure文件,如果此时缺依赖包报错,则安装相应包3 执行源码包安装三部曲./configure --with-php-config=/usr/lcoal/php/bin/php-config,意思是要带上php-config这个配置文件,要更具实际情况来。 make && make install4 在php.ini 文件中配置安装的模块。格式为extension=模块名

Linux Learning Summary (38) Lamp's PHP expansion module installation

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.