简介
上篇文章介绍了php的基本安装,安装成功后就可以使用pecl,phar去很简单的去安装扩展,本文主要描述的是自己去下载和编译,安装过程。
Pear 一个纯粹的PHP代码写函数和类,比如 php-cs-fixer就是用pear写的
pecl (The PHP Extension Community Library) PHP的标准扩展,PECL的扩展都是采用C语言编写的,可以被载入PHP中,给PHP增加额外的功能,比如PHP的mongo 扩展
准备
Phalcon 框架 官网
Yar 框架 官网
安装
install zendopcache 扩展
tar xzf zendopcache-7.0.3.tgz
cd zendopcache-7.0.3
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
install memcache 扩展
tar xzf memcache-3.0.8.tgz
cd memcache-3.0.8
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
install memcached 扩展
需要libmemcached库 [libmemcached-1.0.18.tar.gz]
cd libmemcached-1.0.18
./configure
make && make install
tar xzf memcached-2.2.0.tgz
cd memcached-2.2.0
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config --disable-memcached-sasl
make && make install
install mongodb 扩展
tar xzf mongodb-1.1.6.tgz
cd mongodb-1.1.6
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
install redis 扩展
tar xzf redis-2.2.7.tgz
cd redis-2.2.7
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
install SeasLog 扩展
tar xzf Neeke-SeasLog-SeasLog-1.5.3-12-gdc7ae1a.tar.gz
cd Neeke-SeasLog-dc7ae1a
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
install Swoole 扩展
tar xzf swoole-src-swoole-1.8.5-stable.tar.gz
cd swoole-src-swoole-1.8.5-stable
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
配置
opcache
xhprof
memcache
在php中有2中方式去调用memcache
memcache 原生实现的,支持OO和非OO两套接口并存
memcached 方法多,比如getDelayed,getByKey,addServers 等 没有connect 方法,不支持长连接 使用libmemcached库实现的,只支持OO接口, 支持Binary Protocol,性能更高
memcached的安装和使用
redis
redis 官网
ssdb 官网