,

Xdebug on Ubuntu for WordPress

Turns out enabling Xdebug on Ubuntu for Eclipse PDT is easier than doing the same on Windows.

The short version is installing the module as per this tutorial – http://ubuntuforums.org/showthread.php?t=525257
[bash]
sudo apt-get install php5-dev php-pear
sudo pecl install xdebug

sudo updatedb
locate xdebug (this one finds the xdebug path)
sudo gedit /etc/php/apache2/php.ini
[/bash]

Adding this line (/w the path):
[bash]
zend_extension=”/usr/lib/php5/20060613/xdebug.so”
sudo /etc/init.d/apache2 restart (or sudo apache2ctl restart)
[/bash]
This install the xDebug and enables it.

Then we need to add a few more lines of code in /etc/php5/apache2/php.ini (as in here):

http://holisticsecurity.wordpress.com/2011/07/04/php-xdebug-xampp-win32/
[bash]
xdebug.auto_trace = 0
xdebug.collect_includes = 1
xdebug.collect_params = 0
xdebug.collect_return = 0
xdebug.collect_vars = “Off”
xdebug.default_enable = “On”
xdebug.dump.COOKIE = “”
xdebug.dump.FILES = “”
xdebug.dump.GET = “”
xdebug.dump.POST = “”
xdebug.dump.REQUEST = “”
xdebug.dump.SERVER = “”
xdebug.dump.SESSION = “”
xdebug.dump_globals = 1
xdebug.dump_once = 1
xdebug.dump_undefined = 0
xdebug.extended_info = 1
xdebug.file_link_format = “”
xdebug.idekey = “”
xdebug.manual_url = “http://www.php.net”
xdebug.max_nesting_level = 100
xdebug.overload_var_dump = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = “/tmp”
xdebug.profiler_output_name = “xdebug_profile.%R::%u”

; xdebug.remote_autostart
; Type: boolean, Default value: 0
; Normally you need to use a specific HTTP GET/POST variable to start remote debugging (see Remote
; Debugging). When this setting is set to ‘On’ Xdebug will always attempt to start a remote debugging
; session and try to connect to a client, even if the GET/POST/COOKIE variable was not present.
xdebug.remote_autostart = 1

; xdebug.remote_enable
; Type: boolean, Default value: 0
; This switch controls whether Xdebug should try to contact a debug client which is listening on the
; host and port as set with the settings xdebug.remote_host and xdebug.remote_port. If a connection
; can not be established the script will just continue as if this setting was Off.
xdebug.remote_enable = 1

xdebug.remote_handler = “dbgp”
xdebug.remote_host = “localhost”
xdebug.remote_log = “none”
xdebug.remote_mode = “req”
xdebug.remote_port = 9000
xdebug.show_exception_trace = 0
xdebug.show_local_vars = 0
xdebug.show_mem_delta = 0
xdebug.trace_format = 0
xdebug.trace_options = 0
xdebug.trace_output_dir = “/tmp”
xdebug.trace_output_name = “trace.%c”
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 3
[/bash]
Then create an Eclipse project, click the Debug Configurations

Create a website configuration, select Xdebug, set the paths for the index.php and configure project names; set the web server as well so that this could run smoothly.

Run the project in Debug perspective.

Edit: A great resource for step-by-step setup with screenshots by Wptuts+ – here.


Mario Peshev is a serial martech entrepreneur, global business advisor, angel investor, and author, famous for launching a top 20 enterprise WordPress consultancy and authoring the modern startup formation book, “MBA Disrupted.”

His digital footprint includes 25 years of creating and scaling technical solutions, building and growing digital teams, starting and growing companies from zero to seven figures, acquiring and selling assets and businesses, and investing in global startups like beehiiv, doola, the Stacked Marketer, Alcatraz, SeedBlink.

Peshev spent over 10,000 hours in consulting and training activities for organizations like VMware, SAP, Software AG, CERN, Saudi Aramco since 2006. His books and guides are references in over 30 universities in North America, Europe, and Asia.


Follow Mario on social:

Latest Editions:

Browse by Category

Latest Answers: