您的位置:首页 > 编程语言 > Java开发

Ubuntu 12.04 装配Xdebug 和 配置eclipse

2013-05-03 11:53 302 查看

Ubuntu 12.04 装配Xdebug 和 配置eclipse

www.MyException.Cn 发布于:2013-03-10 09:38:39 浏览: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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: