Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install php extension Module in centos

Shulou Source: shulou.com Published: 2022-06-03 10:51:42 11月15日 Update

This article will explain in detail how to install the php extension module in centos. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Centos installs the php expansion module: 1. Install pecl;2, install libevent-devel;3, and execute the command [echo extension=libevent.so > / etc/php.d/libevent.ini].

This article operating environment: centos7 system, php 7.3, thinkpad T480 computer.

In a centos system, we can generally install the extension module in two ways, one is the yum command, and the other is phpize. Next, let's introduce these two methods and take a look at them together.

1. Yum command

If you previously installed php using the yum command, congratulations that you can install the php extension in the same way. The specific steps are as follows:

Tip: please install pecl before executing the following command. If you have not already installed it, please install it as follows:

/ / Open the corresponding installation version directory cd / usr/local/php/bin/ curl download curl-o go-pear.php http://pear.php.net/go-pear.phar// install php go-pear.php

All right, start installing the php extension:

1. Yum install libevent-devel2, pecl install channel://pecl.php.net/libevent-0.1.03, echo extension=libevent.so > / etc/php.d/libevent.ini

II. Phpize

This approach may be cumbersome to operate, and you should be patient when installing. Let's take a look at the specific installation steps:

/ / download the libevent extension file archive ~ # wget http://pecl.php.net/get/libevent-0.1.0.tgz / / decompress ~ # tar-zxvf libevent-0.1.0.tgz / / enter the source directory ~ # cd libevent-0.1.0/ run the phpize command, and write the full phpize path ~ # / usr/local/php/bin/phpize / / run the configure command When configuring, attach the path of php-config to ~ #. / configure-- with-php-config=/usr/local/php/bin/php-config / / run the make command ~ # make / / Test compilation installation ~ # make test / / formal compilation installation ~ # sudo make install / / modify php.ini Add at the end: extension=libevent.so / / restart the corresponding php-fpm about "centos how to install the php extension module" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.

Tags: Commands methods modules methods articles runs more steps directories systems paths Laian compilation good practical same tedious patient content files Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn Redmi Docker Microsoft