Install some extensions of php In debian: geoip, mongo, redis, libevent, proctitl

Source: Internet
Author: User
Tags geoip inotify install redis
Because of the Project relationship, you need to install some new extensions debianxfce7.2x64. The three below are all installed through apt-get. PHP5.4.4-14deb7u5 (cli) nginx1.2.1apache2.2.221-

Because of the Project relationship, you need to install some new extensions debian xfce 7.2x64. The three of them are installed through apt-get. PHP 5.4.4-14deb7u5 (cli) nginx1.2.1 apache 2.2.22 1: Install using the default method (optimal). Most of the commonly used methods are in the debian repository. You can download them to note that, # indicates that the root user can use su-

Some new extensions need to be installed because of the Project relationship.

All three of debian xfce 7.2x64 are installed through apt-get.

PHP 5.4.4-14 + deb7u5 (cli)

Nginx1.2.1

Apache 2.2.22

1: use the default method for installation (optimal). Most of the commonly used methods are in the debian repository. You can download them to note that # It indicates that root can enter the root account after entering the password through su-enter the password.

#apt-get install php5-geoip#apt-get install php-apc#apt-get install libevent-dev

2: Install with pecl (second)
#pecl install mongo#pecl install channel://pecl.php.net/libevent-0.1.0#pecl install channel://pecl.php.net/proctitle-0.1.2#pecl install inotify#pecl install yaf


After installing pecl, you need to do a few things. One is to add the corresponding so file to the corresponding ini, and the other is to link the ini to conf. d.

For example, the above three extensions, after pecl

In debian

/usr/lib/php5/20100525/mongo.so/usr/lib/php5/20100525/libevent.so/usr/lib/php5/20100525/proctitle.so/usr/lib/php5/20100525/inotify.so/usr/lib/php5/20100525/yaf.so

 

Run the following shell Name in/etc/php5 to create some configuration files: php of debian. ini disperses the configuration file to/etc/php5/conf. d, and conf. d content comes from/etc/php5/mod-available/for the sake of the rigor of the debian package, we will make two links here, instead of directly going to conf. d. ini file.

#echo "extension=mongo.so" > /etc/php5/mods-available/mongo.ini#echo "extension=libevent.so" > /etc/php5/mods-available/libevent.ini#echo "extension=proctitle.so" > /etc/php5/mods-available/proctitle.ini#echo "extension=inotify.so" > /etc/php5/mods-available/inotify.ini#echo "extension=yaf.so" > /etc/php5/mods-available/yaf.ini#ln -s /etc/php5/mods-available/mongo.ini /etc/php5/conf.d/mongo.ini#ln -s /etc/php5/mods-available/libevent.ini /etc/php5/conf.d/libevent.ini#ln -s /etc/php5/mods-available/proctitle.ini /etc/php5/conf.d/proctitle.ini#ln -s /etc/php5/mods-available/inotify.ini /etc/php5/conf.d/inotify.ini#ln -s /etc/php5/mods-available/yaf.ini /etc/php5/conf.d/yaf.ini
Restart the nginx php5-fcgi or apache, you can see that these modules have been loaded successfully 

3: Install the php-redis extension by using the extended source code (Compilation and installation, which is not recommended for debian, provided that the repository does not ).

(You need to install redis server on your own. You can install the software in the compiling environment by referring to the previous articles, such as gcc.

#wget https://redis.googlecode.com/files/redis-2.6.14.tar.gz#tar -zxvf redis#make

)

#tar -zxvf nicolasff-phpredis-2.1.3-124-gd4ad907.tar.gz#cd nicolasff-phpredis-00233a3#phpize#./configure --with-php-config=/usr/bin/php-config
#make && make install#echo "extension=redis.so" > /etc/php5/mods-available/redis.ini#ln -s /etc/php5/mods-available/redis.ini /etc/php5/conf.d/redis.ini

Same as above. You need to restart the server.


4: Install the SDK through the php source code (switch some php extensions installed by default but closed. Here we want to enable pcntl)

#mkdir php#cd php#apt-get source php5

Here we will go to php5-(Version)/ext/pcntl
#cd php5-5.4.4/ext/pcntl#phpize#./configure#make && make install#echo "extension=pcntl.so" > /etc/php5/mods-available/pcntl.ini#ln -s /etc/php5/mods-available/pcntl.ini /etc/php5/conf.d/pcntl.ini

Same as above. Restart the server.
If php reports an error, PHP Warning: Module 'pcntl 'already loaded in Unknown on line 0
It indicates that it has been installed. Now it is installed repeatedly. You need to delete the two pcntl. ini files added above. Then go to the php. ini file
Disable_functions = pcntl_alarm, callback, pcntl_waitpid, latency, pcntl_signal, latency, latency, pcntl_strerror, latency, pcntl_exec, latency, latency, pcntl_setpriority,

Add; comment out. Restart the server. Note that php. ini is different in apache2 and nginx, and apache2 is in/etc/php5/apache2/php. ini nginx I specified/etc/php5/cgi/php in cgi. ini
Check which server you use, and comment out which one is enough.




5. Install uv through git clone (you need to have a git environment)



#git clone https://github.com/chobie/php-uv.git --recursive#cd php-uv#cd libuv && make#cd ..#phpize#./configure

If the error message "config. m4" is not found in phpize, it indicates that you are using 64-bit data. perform the following steps:

#make clean #cd ./libuv#make clean

Modify php-uv/libuv/Makefile

#vim Makefile

It is about to change the position of 27 rows, plus-fPIC

ifdef MSVCuname_S := MINGWendifCPPFLAGS += -Iinclude -Iinclude/uv-private -fPICCARES_OBJS =CARES_OBJS += src/ares/ares__close_sockets.o
Re-execute the previous
#make#cd ..#phpize#./configure#make && make install 

Then

#echo "extension=uv.so" > /etc/php5/mods-available/uv.ini#ln -s /etc/php5/mods-available/uv.ini /etc/php5/conf.d/uv.ini

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.