Home > Article > Backend Development > how to install php extension
1. Install php extension on windows
1. Download
http://pecl.php.net/Yes The official extension library, where we can download the extensions we want.
Related recommendations: "PHP Getting Started Tutorial"
2. Select the version
has installed redis as an example :
Click the
button to enter the windows download interface
When installing the PHP extension for Windows, you need to pay attention to the version selection: PHP version, whether it is linear security, and the number of operating systems.
3. Installation
Extract the downloaded compressed package, then put the php_redis.dll inside into the folder specified in php.ini, load the redis module, and then restart server.
2. Install php extension on linux
1.yum or apt-get installation
2. Use pecl to install
1), pecl install to install
~# pecl install memcached
downloading memcached-2.2.0.tgz .. .
Starting to download memcached-2.2.0.tgz (70,449 bytes)....
2), configure php.ini
By running php --ini Find the location of the php.ini file, and then add extension=memcached.so
3.phpize installation - taking redis as an example
1), download the php extension package
[root@localhost ~]# wget http://pecl.php.net/get/redis-4.0.0.tgz
2), decompress and enter the expansion package directory
[root@localhost ~]# tar -xzvvf redis-4.0.0.tgz
[root@localhost redis-4.0.0]# cd redis-4.0.0
3), Execute phpize
[root@localhost redis-4.0.0]# phpize
4), ./configure
[root@localhost redis-4.0.0]#. /configure --with-php-config=/usr/bin/php-config
5), make && make install
[root@localhost redis-4.0.0]# make && make install
6), configure php.ini
extension=redis.so
4. Direct installation (similar to windows)
Direct download will download For a good compressed package, after decompression, put the file with .so suffix directly into the specified path, and then configure the php.ini file.
The above is the detailed content of how to install php extension. For more information, please follow other related articles on the PHP Chinese website!