Some extensions of PHP installed under Debian geoip,mongo,redis,libevent,proctitle,inotify,pcntl
Because of the relationship of the project, some new extensions need to be installed
Debian Xfce 7.2 x86 The following 3 are installed through Apt-get.
PHP 5.4.4-14+deb7u5 (CLI)
nginx1.2.1
Apache 2.2.22
1: Installed by default method (optimal), most commonly used in the Debian warehouse, can be downloaded to note, #是代表root can be through Su-enter the password after entering the root
#apt-get Install php5-geoip#apt-get install php-apc#apt-get install Libevent-dev
2: Installation via 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 after installation, you need to do a few things, one is to add the corresponding so file to the corresponding INI, followed by the INI link to conf.d
For example, the above 3 extensions, after pecl
In Debian's
/usr/lib/php5/20100525/mongo.so/usr/lib/php5/20100525/libevent.so/usr/lib/php5/20100525/proctitle.so/usr/lib/ Php5/20100525/inotify.so
PHP5 in/ETC/PHP5 executes the following shell naming, which is to build some configuration files, Debian php php.ini the configuration files scattered to the/ETC/PHP5/CONF.D, and conf.d content from/etc/php5/ mods-available/for the strict Debian package, we will make two links here, instead of directly to CONF.D to build the corresponding. 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#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
Restart the Nginx php5-fcgi or Apache to see that these modules have been loaded successfully
3: Through the extension of the source installation (compiled installation, for Debian is not very recommended, if the warehouse is not) installed is the Php-redis extension
(Redis server needs your own, compiled environment these software refer to my previous article installation on the line, GCC and the like
#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#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, restart server required
4: Through the PHP source installation (switch some PHP by default installed but closed extensions, here we want to open is Pcntl)
#mkdir php#cd Php#apt-get Source php5
Here we go. php5-(version number)/ext/pcntl
#cd Php5-5.4.4/ext/pcntl#phpize#./configure#make#echo "extension=pcntl.so" >/etc/php5/mods-available/pcntl.ini #ln-S/etc/php5/mods-available/pcntl.ini/etc/php5/conf.d/pcntl.ini
Ditto, restart the server.
If PHP errors,
PHP warning:module ' pcntl ' already loaded in Unknown on line 0
That means that it has been installed, now it is repeated, you need to add the above two Pcntl.ini file deleted. And then go to the php.ini file.
Disable_functions = Pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_ Wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_ Error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl _setpriority,
Add ; Comment out. Restart the server can be, notice, php.ini in Apache2,nginx inside are different, apache2 in/etc/php5/apache2/php.ini nginx I specify is the CGI inside/etc/php5/cgi/ Ini
Look at the one that you use for the server, just go and comment out whichever you want.