Home > Backend Development > PHP Problem > Install php extension under linux

Install php extension under linux

藏色散人
Release: 2023-03-04 22:38:01
Original
2545 people have browsed it

How to install PHP extension under Linux: 1. Use the [pecl install xxxx (extension)] command to install the PHP extension; 2. Compile and install the PHP extension through the [make && make install] command.

Install php extension under linux

Recommended: "PHP Video Tutorial"

PHP extension installation in Linux environment

1. Use pecl and pear tools to install PHP extensions

pecl install xxxx(扩展名)
Copy after login

2. Compile and install method

#php源码中的ext目录下含有一些常用的扩展
#举例安装一个mysqli扩展
cd /root/php-7.1.9/ext/mysqli
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install 
 
#tip
#有些扩展会提示 config0.m4 不存在,一般是因为m4文件命名问题
#如果源码中没有你要的扩展,比如redis扩展在ext目录下不存在,直接使用pecl install安装,如果pecl安装失败,百度一下吧(github)
Copy after login

The above is the detailed content of Install php extension under linux. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template