1: 首先還是下載
猛擊這裡下載xdebug-2.1.2.tgz
我下載到downloads目錄. 在/home/yourName/Downloads/這裡.
2:解壓編譯
cd 進去Downloads目錄後 依次運行下面的命令
- tar -xvzf xdebug-2.1.2.tgz
- cd xdebug-2.1.2
- phpize
(如果phpize沒有這個command,需要安裝一次phpize,phpize可以讓php支持擴展模塊.
- sudo apt-get install php5-dev
這個過程有幾分鐘.主要是網速慢 - -)
- ./configure
- make
- make install
會有這個界面
- See any operating system documentation about shared libraries for
- more information, such as the ld(1) and ld.so(8) manual pages.
- ----------------------------------------------------------------------
- Installing shared extensions: /usr/lib/php5/20090626+lfs/
-
-
- +----------------------------------------------------------------------+
- | |
- | 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. |
- | |
- +----------------------------------------------------------------------+
如果make install出現失敗,檢查是否有權限.切換到root權限再執行
- su
- ********
- cp modules/xdebug.so /usr/lib/php5/20090626+lfs
��裡也是一樣,如果cp出了問題,手動復制一下一樣的.
3:編輯php.ini
終端
- gvim /etc/php5/apache5/php.ini
添加
- zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
如果不能修改php.ini,切換下賬戶用root來修改.
重啟apache
- sudo /etc/init.d/apache2 restart
4:查看phpinfo
在最開頭有zend那裡出現
- This program makes use of the Zend Scripting Language Engine:
- Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
- with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
安裝成功