這篇文章主要介紹了關於Centos 下php安裝配置xdebug擴展,有著一定的參考價值,現在分享給大家,有需要的朋友可以參考一下
1、下載安裝xdebug
取得xdebug
wget http://www.xdebug.org/files/xdebug-2.3.3.tgz
解壓縮
tar zxvf xdebug-2.3.3.tgz
進入解壓縮模組
cd xdebug-2.3.3
建立外掛模組
/usr/local/php/bin/phpize
配置xdebug
./configure –enable-xdebug –with-php-config=/usr/local/php/bin/php-config
編譯安裝
make && make install
按照上述步驟安裝,如果沒有什麼特殊情況的話安裝會順利的進行,最後出現如下結果表示安裝成功
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/ +----------------------------------------------------------------------+ | | | INSTALLATION INSTRUCTIONS | | ========================= | | | | See http://xdebug.org/install.php#configure-php for instructions | | on how to enable Xdebug for PHP. | | | | Documentation is available online as well: | | - A list of all settings: http://xdebug.org/docs-settings.php | | - A list of all functions: http://xdebug.org/docs-functions.php | | - Profiling instructions: http://xdebug.org/docs-profiling2.php | | - Remote debugging: http://xdebug.org/docs-debugger.php | | | | | | NOTE: Please disregard the message | | You should add "extension=xdebug.so" to php.ini | | that is emitted by the PECL installer. This does not work for | | Xdebug. | | | +----------------------------------------------------------------------+
2、設定php支援xdebug
#開啟php.ini
vi /usr/local/php/etc/php.ini
新增設定資訊
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so [Xdebug] xdebug.remote_enable = 1 //开启远程调试 xdebug.remote_host = 192.168.17.90 //远程ip地址抑或是本机地址 xdebug.remote_port = 9000 //远程IDE服务器监听端口 xdebug.remote_handler=DBGP //使用的协议
php腳本使用phpinfo()查看php的設定如下圖,說明設定成功
以上是Centos 下php安裝配置xdebug擴充的詳細內容。更多資訊請關注PHP中文網其他相關文章!