SlideShare a Scribd company logo
Debugging DrupalSetting up a local development environment
Tools of the TradeWeb server solution stackWindows: XAMPPMac: MAMPIntegrated development environment (IDE)AptanaWeb browserFirefox + add-ons
Step 1: Set up your serverMAMP 1.8.3XAMPP 1.7.1 (older version with PHP 5.2) from Sourceforge: http://sourceforge.net/projects/xampp/files/
Step 1: Edit PHP settingsFind php.iniMAMP: /Applications/MAMP/conf/PHP5/php.iniXAMPP: c:\xampp\PHP\php.inierror_reporting = E_ALLdisplay_errors = Ondisplay_startup_errors = onlog_errors = onerror_log = “/path/to/php_error.log”
Step 1: Edit PHP settingsFind [xdebug] section towards the end of the fileUncomment the line zend_extension=… by removing the semicolonAdd the following parameters after that line:xdebug.remote_enable=1xdebug.remote_handler="dbgp"xdebug.collect_params=3xdebug.show_local_vars=Onxdebug.dump_globals=Onxdebug.show_exception_trace=Onxdebug.remote_mode=reqxdebug.idekey=defaultFind [Zend] sectionComment the line zend_extension=… by prepending a semicolon
Step 1: Verify changesRestart *AMPGet to the php info page (via Devel module or *AMP website)
Step 2: Set up AptanaDownload and install Aptana Studio from http://www.aptana.org/studio/download (standalone, full installer)Install PDT SDK 2.1.2Set up your workspaceFile > New Project…PHP > PHP Project
Step 2: Set up AptanaAptana Studio > Preferences > PHP > Debug > Default Settings group panelSet debugger to XdebugClick Configure, ensure Xdebug is on port 9000Click “PHP Executables…”, then “Add…”Add a new PHP executable which points to *AMP’s php executable (/Applications/MAMP/bin/php5/bin/php, c:\xampp\bin\...\) and the php.ini file (/Applications/MAMP/conf/php5/php.ini)Click OKReturn to the group panel and verify that the PHP executable is setRestart the server
Step 2: Set up AptanaAssociate Drupal file extensions as PHP filesPreferences > General > Content TypesWithin Content Types > Text select PHP Content Type and add *.module and *.installPreferences > General > Editors > File AssociationsAdd *.module and *.install extensionUnder Associated editors selected PHP editor and click Default
Step 2: Set up AptanaAdd the PHP debug perspective
Step 3: Set up FirefoxInstall Xdebug Helper add-on: https://addons.mozilla.org/en-US/firefox/addon/3960Toggle Xdebug sessionToggle Xdebug profiler
Step 3: Set up FirefoxDefault configuration for add-on should be fine
Presto!Ensure Firefox is not working in offline modeToggle on the Xdebug sessionReload the page
Printing out variablesFrom PHP:var_dump( $var1[, $var2, $var3, …] );var_export( $var[, $returnAsString] );print_r( $var[, $returnAsString] );From the Devel module:dprint_r()Better formatting of code than print_r()dsm()Print into the messages box“Less likely to wreck your beautiful page layout”
Additional ResourcesAbout Xdebug Helper Firefox add-on: http://code.google.com/p/syslogr-utils/wiki/XdebugHelperSettings up a debugging environment in Aptana: http://docs.aptana.com/docs/index.php/Developing_with_the_Aptana_PHP_PluginXdebug website:http://xdebug.org/

More Related Content

What's hot (20)

PDF
Installing php 7.4 Nginx Laravel 7.x on Centos 8
Raja Rozali Raja Hasan
 
PPT
Installation of Drupal on Windows XP with XAMPP
Rupesh Kumar
 
PPTX
8 Web Practices for Drupal
Wingston
 
PPT
Mantis Installation for Windows Box
guest34a3a419
 
PPT
Installation of Drupal on Windows XP
Rupesh Kumar
 
DOCX
Installing symfony within netbeans and WAMP
Riyad Bin Zaman
 
PPTX
How to Install Magento 2 on XAMPP Server localhost.
Web Visitors
 
PPTX
Ilias 4 # clients - On shared hosting with cPanel
leer_thuiz_com
 
TXT
Laravel error
Milon Kanrar
 
PDF
Installation instruction of Testlink
usha kannappan
 
PDF
PHP on Google App Engine
tim4h0blyn
 
PDF
Build website in_django
swee meng ng
 
PDF
Introduzione ai test automatici con PHPunit
Fabio Giannese (Diodœ)
 
PDF
The Critical Path for Startups
Michael Herlache
 
PDF
CakePHP and AJAX
Mark Scherer
 
PPT
Installation of Joomla on Windows XP
Rupesh Kumar
 
PPTX
Flask
Mamta Kumari
 
DOCX
Instruction Sheet to Setup CI
vodQA
 
PPT
Apache
HAINIRMALRAJ
 
PDF
Installing php and my sql locally using xampp
peyman Ghader Kurehpaz
 
Installing php 7.4 Nginx Laravel 7.x on Centos 8
Raja Rozali Raja Hasan
 
Installation of Drupal on Windows XP with XAMPP
Rupesh Kumar
 
8 Web Practices for Drupal
Wingston
 
Mantis Installation for Windows Box
guest34a3a419
 
Installation of Drupal on Windows XP
Rupesh Kumar
 
Installing symfony within netbeans and WAMP
Riyad Bin Zaman
 
How to Install Magento 2 on XAMPP Server localhost.
Web Visitors
 
Ilias 4 # clients - On shared hosting with cPanel
leer_thuiz_com
 
Laravel error
Milon Kanrar
 
Installation instruction of Testlink
usha kannappan
 
PHP on Google App Engine
tim4h0blyn
 
Build website in_django
swee meng ng
 
Introduzione ai test automatici con PHPunit
Fabio Giannese (Diodœ)
 
The Critical Path for Startups
Michael Herlache
 
CakePHP and AJAX
Mark Scherer
 
Installation of Joomla on Windows XP
Rupesh Kumar
 
Instruction Sheet to Setup CI
vodQA
 
Apache
HAINIRMALRAJ
 
Installing php and my sql locally using xampp
peyman Ghader Kurehpaz
 

Similar to Setting up a debugging environment for Drupal (20)

PPTX
Drupal Development w/ PhpStorm and Xdebug
Chris Haynes
 
ODP
Drupal development
Dennis Povshedny
 
PPT
How to? Drupal developer toolkit. Dennis Povshedny.
DrupalCampDN
 
PDF
Xdebug as a Drupal debugging tool
Vladimir Melnic
 
PPTX
Xdebug
Bryce Embry
 
PDF
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Francisco José Seva Mora
 
PPTX
Drupal Development Tips
Chris Tankersley
 
PDF
Debugging PHP with Xdebug - PHPUK 2018
Mark Niebergall
 
PDF
Getting Started With Xdebug
Jeremy Ward
 
PDF
Debugging PHP With Xdebug
Mark Niebergall
 
ODP
Xdebug for Beginners
Sean Prunka
 
PDF
Xdebug from a to x
Gennady Feldman
 
PPTX
XDebug For php debugging
Omid Khosrojerdi
 
PDF
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
phpbarcelona
 
PPTX
Drupal Camp Porto - Developing with Drupal: First Steps
Luís Carneiro
 
PDF
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Bastian Feder
 
PDF
Profiling PHP with Xdebug / Webgrind
Sam Keen
 
PDF
Debugging Drupal - How to Debug your Drupal Application
Zyxware Technologies
 
PPTX
Drupaljdnndkdkckmfkfkkffmfkkfkfk_Part1.pptx
DSAISUBRAHMANYAAASHR
 
PPTX
Using MAMP for Web Development
Eric Greene
 
Drupal Development w/ PhpStorm and Xdebug
Chris Haynes
 
Drupal development
Dennis Povshedny
 
How to? Drupal developer toolkit. Dennis Povshedny.
DrupalCampDN
 
Xdebug as a Drupal debugging tool
Vladimir Melnic
 
Xdebug
Bryce Embry
 
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Francisco José Seva Mora
 
Drupal Development Tips
Chris Tankersley
 
Debugging PHP with Xdebug - PHPUK 2018
Mark Niebergall
 
Getting Started With Xdebug
Jeremy Ward
 
Debugging PHP With Xdebug
Mark Niebergall
 
Xdebug for Beginners
Sean Prunka
 
Xdebug from a to x
Gennady Feldman
 
XDebug For php debugging
Omid Khosrojerdi
 
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
phpbarcelona
 
Drupal Camp Porto - Developing with Drupal: First Steps
Luís Carneiro
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Bastian Feder
 
Profiling PHP with Xdebug / Webgrind
Sam Keen
 
Debugging Drupal - How to Debug your Drupal Application
Zyxware Technologies
 
Drupaljdnndkdkckmfkfkkffmfkkfkfk_Part1.pptx
DSAISUBRAHMANYAAASHR
 
Using MAMP for Web Development
Eric Greene
 
Ad

Recently uploaded (20)

PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Ad

Setting up a debugging environment for Drupal

  • 1. Debugging DrupalSetting up a local development environment
  • 2. Tools of the TradeWeb server solution stackWindows: XAMPPMac: MAMPIntegrated development environment (IDE)AptanaWeb browserFirefox + add-ons
  • 3. Step 1: Set up your serverMAMP 1.8.3XAMPP 1.7.1 (older version with PHP 5.2) from Sourceforge: http://sourceforge.net/projects/xampp/files/
  • 4. Step 1: Edit PHP settingsFind php.iniMAMP: /Applications/MAMP/conf/PHP5/php.iniXAMPP: c:\xampp\PHP\php.inierror_reporting = E_ALLdisplay_errors = Ondisplay_startup_errors = onlog_errors = onerror_log = “/path/to/php_error.log”
  • 5. Step 1: Edit PHP settingsFind [xdebug] section towards the end of the fileUncomment the line zend_extension=… by removing the semicolonAdd the following parameters after that line:xdebug.remote_enable=1xdebug.remote_handler="dbgp"xdebug.collect_params=3xdebug.show_local_vars=Onxdebug.dump_globals=Onxdebug.show_exception_trace=Onxdebug.remote_mode=reqxdebug.idekey=defaultFind [Zend] sectionComment the line zend_extension=… by prepending a semicolon
  • 6. Step 1: Verify changesRestart *AMPGet to the php info page (via Devel module or *AMP website)
  • 7. Step 2: Set up AptanaDownload and install Aptana Studio from http://www.aptana.org/studio/download (standalone, full installer)Install PDT SDK 2.1.2Set up your workspaceFile > New Project…PHP > PHP Project
  • 8. Step 2: Set up AptanaAptana Studio > Preferences > PHP > Debug > Default Settings group panelSet debugger to XdebugClick Configure, ensure Xdebug is on port 9000Click “PHP Executables…”, then “Add…”Add a new PHP executable which points to *AMP’s php executable (/Applications/MAMP/bin/php5/bin/php, c:\xampp\bin\...\) and the php.ini file (/Applications/MAMP/conf/php5/php.ini)Click OKReturn to the group panel and verify that the PHP executable is setRestart the server
  • 9. Step 2: Set up AptanaAssociate Drupal file extensions as PHP filesPreferences > General > Content TypesWithin Content Types > Text select PHP Content Type and add *.module and *.installPreferences > General > Editors > File AssociationsAdd *.module and *.install extensionUnder Associated editors selected PHP editor and click Default
  • 10. Step 2: Set up AptanaAdd the PHP debug perspective
  • 11. Step 3: Set up FirefoxInstall Xdebug Helper add-on: https://addons.mozilla.org/en-US/firefox/addon/3960Toggle Xdebug sessionToggle Xdebug profiler
  • 12. Step 3: Set up FirefoxDefault configuration for add-on should be fine
  • 13. Presto!Ensure Firefox is not working in offline modeToggle on the Xdebug sessionReload the page
  • 14. Printing out variablesFrom PHP:var_dump( $var1[, $var2, $var3, …] );var_export( $var[, $returnAsString] );print_r( $var[, $returnAsString] );From the Devel module:dprint_r()Better formatting of code than print_r()dsm()Print into the messages box“Less likely to wreck your beautiful page layout”
  • 15. Additional ResourcesAbout Xdebug Helper Firefox add-on: http://code.google.com/p/syslogr-utils/wiki/XdebugHelperSettings up a debugging environment in Aptana: http://docs.aptana.com/docs/index.php/Developing_with_the_Aptana_PHP_PluginXdebug website:http://xdebug.org/