强烈推荐 php安装扩展
pecl install <扩展名> # eg:pecl install swoole
php扩展包下载网址
下边是手动安装
php安装msgpack扩展 示例
wget https://pecl.php.net/get/msgpack-2.0.2.tgz #下载
tar xvf msgpack-2.0.2.tgz #解压
cd msgpack-2.0.2
phpize #phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
./configure --with-php-config=/usr/local/php/bin/php-config #--with-php-config指定php配置的路径(因为可以装多个版本的php)
make && make install
#扩展安装完成,会展示扩展存在的路径,编辑php.ini,添加扩展的绝对路径,保存退出
#extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012"
#extension=msgpack.so
#或者, 推荐上边
#extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/msgpack.so
service php-fpm restart #重启php
扩展生成后的路径:/usr/local/php/lib/php/extensions/no*
xdebug扩展
wget https://pecl.php.net/get/xdebug-2.5.5.tgz #下载
tar xvf xdebug-2.5.5.tgz #解压
cd xdebug-2.5.5
phpize #phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
./configure --with-php-config=/usr/local/php/bin/php-config #--with-php-config指定php配置的路径(因为可以装多个版本的php)
make && make install
#扩展安装完成,会展示扩展存在的路径,编辑php.ini,添加扩展的绝对路径,保存退出,msgpack已经写过路径,这里不用写
#zend_extension=xdebug.so
#xdebug.auto_trace = on
#xdebug.collect_params = on
#xdebug.collect_return = on
#xdebug.profiler_enable = on
#xdebug.profiler_output_dir ="/php/ext/xdebug_profilers"
#xdebug.trace_output_dir = "/tmp/ext/xdebug_traces"
#;xdebug.remote_log = "/tmp/xdebug_remote_log" 添加日志
#;远程调试设置
#xdebug.remote_enable = on
#xdebug.remote_host = localhost
#xdebug.remote_port = 9000
#xdebug.remote_autostart = on
#xdebug.idekey=PHPSTORM
service php-fpm restart #重启php
使用的phpstorm编辑器单步调试的