Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Directory (?) [+]
To view the PHP version:
-v
To view the specified PHP version:
/usr/local/php/bin/php -v
See the extensions that PHP has installed
-m
View a version of PHP installed extensions on the server
/usr/local/php/bin/php -m
See the location of php.ini
/usr/local/php/bin/php --ini
Install extensionsMethod One: Install with the yum command
If PHP is installed with the Yum command, the extension can also be installed via Yum
Perform the following three steps, in which the input content is required to perform a "carriage return":
1、命令行运行yum install libevent-devel2、命令行运行pecl install channel://pecl.php.net/libevent-0.1.03、命令行运行echo extension=libevent.so > /etc/php.d/libevent.ini
In the above steps, you need to install PECL, if not, the following is the installation method:
//打开对应安装版本目录cd /usr/local/php/bin/ //curl下载 curl -o go-pear.php http://pear.php.net/go-pear.phar //安装php go-pear.php
Method Two: Phpize installation
Download libevent extension file compression package (in the current system which directory download random) ~# wget http:Pecl.php.net/get/libevent-0.1.0.tgzExtract Files ~# TAR-ZXVF libevent-0.1. 0.tgz/ /Enter the source directory ~# cd libevent-0.1. 0/ //Run phpize command, write full phpize path ~#/usr/local/php/bin/phpize //Run Configure command, configure the path to the php-config to attach ~#./configure--with-php-config=/ Usr/local/php/bin/php-config //Run make command ~# make //test Compile Install ~# Make Test //Formal Compile install ~# sudo make Install /Modify php.ini, end add: extension=libevent.so //restart corresponding PHP-FPM
Two ways to install PHP extensions for CentOS