当前位置: 代码迷 >> Eclipse >> Ubuntu 12.04 装配Xdebug 和 配置eclipse
  详细解决方案

Ubuntu 12.04 装配Xdebug 和 配置eclipse

热度:332   发布时间:2016-04-23 01:33:10.0
Ubuntu 12.04 安装Xdebug 和 配置eclipse

Requirements:
-LAMP already installed
-Eclipse-php already installed

Server configuration:
-Open a terminal
-run: sudo apt-get install php5-xdebug
-run: sudo nano /etc/php5/conf.d/xdebug.ini
-Don't delete the content of this file, just go to the end of the file add 2 blank lines and paste the next configuration:

xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"

-save changes
-run: sudo /etc/init.d/apache2 restart

Eclipse configuration:
-Open eclipse-php
-On the eclipse main menu go to: Window--> Preferences
-Navigate on the tree menu to: PHP--> Debug
-open the dropDownList "work with"
-On "PHP Debugger" select "XDebug"
-Leave alone "Server" and "PHP Executables"
-Save changes and close the window
-On the eclipse main menu go to: Run--> Debug configurations...
-Do a double click over "PHP Web Page" just to add a new setting
-On the DropDowList "Server Debugger" select "XDebug"
-On the file section browse and select the "index.php" of your project or whatever file you need to start your application
-Uncheck "Break at Fist Line"
-Apply changes and close the window
-On the eclipse main menu go to: Window--> Web Browser--> Default System Web Browser


Testing xdebug
-Open a project with source code that already is hosted in your LAMP server
-Place a "break point" at some point of you script
-Press "F11" to start the debugger
-Your code should stop at the break point
-Now move the mouse over variables so watch its values

  相关解决方案