歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux安裝xdebug.(Debian,Ubuntu)

Linux安裝xdebug.(Debian,Ubuntu)

日期:2017/2/28 16:06:53   编辑:Linux教程

1: 首先還是下載

猛擊這裡下載xdebug-2.1.2.tgz

我下載到downloads目錄. 在/home/yourName/Downloads/這裡.


2:解壓編譯

cd 進去Downloads目錄後 依次運行下面的命令

  1. tar -xvzf xdebug-2.1.2.tgz

  1. cd xdebug-2.1.2
  1. phpize
(如果phpize沒有這個command,需要安裝一次phpize,phpize可以讓php支持擴展模塊.
  1. sudo apt-get install php5-dev
這個過程有幾分鐘.主要是網速慢 - -)
  1. ./configure
  1. make
  1. make install
會有這個界面
  1. See any operating system documentation about shared libraries for
  2. more information, such as the ld(1) and ld.so(8) manual pages.
  3. ----------------------------------------------------------------------
  4. Installing shared extensions: /usr/lib/php5/20090626+lfs/
  5. +----------------------------------------------------------------------+
  6. | |
  7. | INSTALLATION INSTRUCTIONS |
  8. | ========================= |
  9. | |
  10. | See http://xdebug.org/install.php#configure-php for instructions |
  11. | on how to enable Xdebug for PHP. |
  12. | |
  13. | Documentation is available online as well: |
  14. | - A list of all settings: http://xdebug.org/docs-settings.php |
  15. | - A list of all functions: http://xdebug.org/docs-functions.php |
  16. | - Profiling instructions: http://xdebug.org/docs-profiling2.php |
  17. | - Remote debugging: http://xdebug.org/docs-debugger.php |
  18. | |
  19. | |
  20. | NOTE: Please disregard the message |
  21. | You should add "extension=xdebug.so" to php.ini |
  22. | that is emitted by the PECL installer. This does not work for |
  23. | Xdebug. |
  24. | |
  25. +----------------------------------------------------------------------+
如果make install出現失敗,檢查是否有權限.切換到root權限再執行
  1. su
  1. ********
  1. cp modules/xdebug.so /usr/lib/php5/20090626+lfs
��裡也是一樣,如果cp出了問題,手動復制一下一樣的.
3:編輯php.ini 終端
  1. gvim /etc/php5/apache5/php.ini
添加
  1. zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
如果不能修改php.ini,切換下賬戶用root來修改. 重啟apache
  1. sudo /etc/init.d/apache2 restart
4:查看phpinfo
在最開頭有zend那裡出現
  1. This program makes use of the Zend Scripting Language Engine:
  2. Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
  3. with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
安裝成功
Copyright © Linux教程網 All Rights Reserved