how to install php extension

Barbara Streisand
Release: 2023-02-23 13:08:02
Original
3845 people have browsed it

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.

how to install php extension

Related recommendations: "PHP Getting Started Tutorial"

2. Select the version

has installed redis as an example :

how to install php extensionhow to install php extension

Click thehow to install php extension

button to enter the windows download interface

how to install php extension

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.

how to install php extension

2. Install php extension on linux

1.yum or apt-get installation

how to install php extension

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!