Configuring Xdebug in Lamp for debugging

View previous topic View next topic Go down

Configuring Xdebug in Lamp for debugging

Post by BIT0122-Amit on Fri Nov 19, 2010 9:58 pm

In case you do not know, Lamp is the linux apache mysql Perl/Python/PHP thingy for linux.

And the xampp for linux is something else.

The difference? You need to configure Lamp, xampp has everything pre configured.

After you install lamp, you have to configure lots of things, but that still does not include the debugging things for lamp.

To debug, Xdebug is a worthy choice. (is there any better alternative?)

To install it, at first go to this website.

Then follow the instructions from there.
After you follow the instructions, you only have installed xDebug, not configured and prepared it for programming.

I will consider that you have installed in the standard settings.

I.e. your php.ini file is in /etc/php5/apache2/

Now,open a terminal, and write:

Code:
sudo gedit /etc/php5/apache2/php.ini

inside the file, you need to make 3 changes, and a couple of new entries.

change 1:
implicit_flush = Off
to
implicit_flush = On

change 2:
display_errors = Off
to
display_errors = On

change 3:
html_errors = Off
to
html_errors = On

New entries:
Code:
;must have xdebug settings
;xdebug.profiler_output_dir = "/tmp/xdebug/"
xdebug.remote_mode=req
xdebug.profiler_enable = On
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
;xDebug Configuration ends


;optional xdebug settings
xdebug.collect_vars=On
xdebug.show_local_vars=On
xdebug.dump.SERVER=HTTP_HOST, SERVER_NAME
xdebug.dump_globals=On
xdebug.collect_params=4

Now restart the server:
Code:
sudo /etc/init.d/apache2 restart

And you are done.

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum