1024programmer Linux How to correctly install PHP extension under Linux-Linux operation and maintenance

How to correctly install PHP extension under Linux-Linux operation and maintenance

The correct installation method of php extension under linux: 1. Download and decompress the extension file; 2. Enter the decompression file directory and check the system configuration; 3. Execute the [make && make install] command to install the extension.

Method 1: Compile and install

(learning video recommendation: linux video tutorial)

Specific steps:

//Download files
 #wget http://pecl.php.net/get/zip-1.12.4.tgz
 //unzip files
 #tar zxfv zip-1.12.4.tgz
 //Enter the decompressed file directory
 #cd zip-1.12.4
 //Check the system configuration and start configuration, specify the configuration when installing PHP
 #./configure --with-php-cOnfig=/usr/local/php-5.2.17/bin/php-config
 //compile
 #make
 //test
 #make test
 //Install
 #make install

Method 2: pecl installation

Concrete 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 with yum

yum install php-pear,php-devel

2. Update the pecl library

pecl channel-update pecl.php.net

3. Install the corresponding Extension

pecl install redis

If you do not add the path of php to the environment variable, you need to use the absolute address

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

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/how-to-correctly-install-php-extension-under-linux-linux-operation-and-maintenance/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索