How to debug your PHP project
It is assumed that the server is installed locally to work (php apache mysql etc ...).
Get Eclipse from here
On Eclipse go to Run -> Debug Configurations
Click new configuration
Folder: Server
*Name: php-debugger (can chose another name, of course! :) )
*PHP server - default PHP Web Server
*File: /newProject/index.php
Open configure...
*Debugger: xdebug
*base url: http://localhost
*local web root: /var/www/html/newProject
*OK
*
Folder: Debugger
*Server Debuger --> XDebug
APPLY
CLOSE
go to /var/www/html and create a new folder "newProject"
Create a PHP Project in eclipse (using, of course, the folder you created)
Create new file index.php with some code to text and set a breakpoint with double click on the left side of the code
Open php.ini
sudo gedit /etc/php5/apache2/php.ini
past the code
Run, Debug as... , PHP web application
Will open a web browser inside eclipse
________
ZXCoders
Comments
Marco
Tue, 01/26/2016 - 12:20
Permalink
Eclipse Luna
I recomend Eclipse Luna. Mars has to many bugs...
Luna