Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install php extension under linux

Shulou Source: shulou.com Published: 2022-06-02 00:31:59 09月21日 Update

Editor to share with you how to install the php extension under linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The correct installation method of php extension under linux: 1, download and extract the extension file; 2, enter the decompressed file directory and check the system configuration; 3, execute the [make & & make install] command to install the extension.

Method 1: compile and install

Specific steps:

/ / download file # wget http://pecl.php.net/get/zip-1.12.4.tgz// extract file # tar zxfv zip-1.12.4.tgz// enter the extracted file directory # cd zip-1.12.4// check system configuration to start configuration Specify the configuration when installing PHP #. / configure-- with-php-config=/usr/local/php-5.2.17/bin/php-config// compilation # make// Test # make test// installation # make install

Method 2: install in pecl mode

Specific steps:

1. First check whether there is pecl under / usr/local/php/bin/. Pear (php-pear is installed to use phpize in pecl) if not, install it with yum

Yum install php-pear,php-devel

2. Update the pecl library

Pecl channel-update pecl.php.net

3. Install the appropriate extension

Pecl install redis

If the path to php is not added to the environment variable, you need to use an absolute address

4. Generally, extensions installed through pecl are automatically added to the configuration of php.ini. If the installed extension is not queried through phpinfo () or php-m, then add the corresponding so file to php.ini (extension=redis.so) and restart php-fpm.

The above is all the contents of how to install the php extension under linux. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Files configurations methods checks contents steps directories articles systems compilations not much variables commands addresses most ways times more environment knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn macOS Shulou Information NVidia MariaDB