強烈推薦 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編輯器單步調試的