php dynamic installing extensions

The following extensions, for example to install phpredis

Download the extension source, extract

[root@localhost ~]# wget phpredis-5.1.1.tar.gz
[root@localhost ~]# tar -zxf phpredis-5.1.1.tar.gz

Into the source directory, run phpize, used to generate the configure file, if a configuration environment variable, you can run phpize directly, otherwise, you need to use the full path

[root@localhost ~]# cd xxx
[root@localhost phpredis-5.1.1]# phpize
或者
[root@localhost phpredis-5.1.1]# /usr/local/php7/bin/phpize

Run configure

[root@localhost phpredis-5.1.1]# ./configure --with-php-config=/usr/local/php7/bin/php-config

Execution make && make install to start the installation

[root@localhost phpredis-5.1.1]# make && make install

After installation is output path extension installation, edit the php.ini, last line extension = 'propagation paths'

[root@localhost phpredis-5.1.1]# vim /usr/local/php7/etc/php.ini

[repeat] 
extension = '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20180731/redis.so'

The final restart php-fpm, php -m module is present then the installation is successful

 

Guess you like

Origin www.cnblogs.com/nonsec/p/12179802.html