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