Quick installation of php-memcached extension via pecl quick installation of php-memcached extension via pecl
In the past, php-memcached was always installed through source code compilation. the dependency and compilation speed kept you waiting. We can learn from the internet that we can use pecl to quickly install this extension. here we will organize and record it.
System environment: CentOS-7.1 Php memcached module 1. install libmemcached
# Yum-y install libmemcached-devel Loaded plugins: langpacksResolving Dependencies --> Running transaction check ---> Package libmemcached-devel.x86_64. 0.16-3. el7 will be installed --> Processing Dependency: cyrus-sasl-devel (x86-64) for package: libmemcached-devel-1.0.16-3.el7.x86_64 --> Running transaction check ---> Package cyrus-sasl-devel.x86_64 0: 2. 1.26-17. el7 will be installed --> Processing D Ependency: cyrus-sasl (x86-64) = 2.1.26-17. el7 for package: cyrus-sasl-devel-2.1.26-17.el7.x86_64 --> Running transaction check ---> Package cyrus-sasl.x86_64 0: 2. 1.26-17. el7 will be installed ............ Omit several rows ............ Installed: libmemcached-devel.x86_64. 0.16-3. el7 Dependency Installed: cyrus-sasl.x86_64. 1.26-17. el7 cyrus-sasl-devel.x86_64. 1.26-17. el7 Complete!
2. install the php-memcached extension
# Pecl install memcached WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update downloading memcached-2.2.0.tgz... starting to download memcached-2.2.0.tgz (70,449 bytes )................. done: 70,449 bytes 15 source files, building running: phpize indexing ING for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220 100525 libmemcached directory [no]:/usr building in/var/tmp/pear-build-rootb7OPED/memcached-2.2.0 running: /var/tmp/memcached/configure -- with-libmemcached-dir =/usr ............ Omit several rows ............ Build process completed successfully Installing '/usr/lib64/php/modules/memcached. so 'Install OK: channel: // pecl.php.net/memcached-2.2.0 configuration option "php_ini" is not set to php. ini location You shoshould add "extension = memcached. so "to php. ini
Memcached php module
3. append the module to the php. ini file.
# extension=memcached.so
Tips: If you cannot install memcached by directly using pecl install memcached, you can use the following method --
# pecl download memcached# tar zxvf memcached-xxx# cd memcached-xxx# phpize# ./configure --with-libmemcached-dir=/xxxx/xxx/xxx