SlideShare a Scribd company logo
1 of 15
Debugging Drupal Setting up a local development environment
Tools of the Trade Web server solution stack Windows: XAMPP Mac: MAMP Integrated development environment (IDE) Aptana Web browser Firefox + add-ons
Step 1: Set up your server MAMP 1.8.3 XAMPP 1.7.1 (older version with PHP 5.2) from Sourceforge: http://sourceforge.net/projects/xampp/files/
Step 1: Edit PHP settings Find php.ini MAMP: /Applications/MAMP/conf/PHP5/php.ini XAMPP: c:amppHPhp.ini error_reporting = E_ALL display_errors = On display_startup_errors = on log_errors = on error_log = “/path/to/php_error.log”
Step 1: Edit PHP settings Find [xdebug] section towards the end of the file Uncomment the line zend_extension=… by removing the semicolon Add the following parameters after that line: xdebug.remote_enable=1 xdebug.remote_handler="dbgp" xdebug.collect_params=3 xdebug.show_local_vars=On xdebug.dump_globals=On xdebug.show_exception_trace=On xdebug.remote_mode=req xdebug.idekey=default Find [Zend] section Comment the line zend_extension=… by prepending a semicolon
Step 1: Verify changes Restart *AMP Get to the php info page (via Devel module or *AMP website)
Step 2: Set up Aptana Download and install Aptana Studio from http://www.aptana.org/studio/download (standalone, full installer) Install PDT SDK 2.1.2 Set up your workspace File > New Project… PHP > PHP Project
Step 2: Set up Aptana Aptana Studio > Preferences > PHP > Debug > Default Settings group panel Set debugger to Xdebug Click Configure, ensure Xdebug is on port 9000 Click “PHP Executables…”, then “Add…” Add a new PHP executable which points to *AMP’s php executable (/Applications/MAMP/bin/php5/bin/php, c:amppin.. and the php.ini file (/Applications/MAMP/conf/php5/php.ini) Click OK Return to the group panel and verify that the PHP executable is set Restart the server
Step 2: Set up Aptana Associate Drupal file extensions as PHP files Preferences > General > Content Types Within Content Types > Text select PHP Content Type and add *.module and *.install Preferences > General > Editors > File Associations Add *.module and *.install extension Under Associated editors selected PHP editor and click Default
Step 2: Set up Aptana Add the PHP debug perspective
Step 3: Set up Firefox Install Xdebug Helper add-on: https://addons.mozilla.org/en-US/firefox/addon/3960 Toggle Xdebug session Toggle Xdebug profiler
Step 3: Set up Firefox Default configuration for add-on should be fine
Presto! Ensure Firefox is not working in offline mode Toggle on the Xdebug session Reload the page
Printing out variables From 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 Resources About Xdebug Helper Firefox add-on: http://code.google.com/p/syslogr-utils/wiki/XdebugHelper Settings up a debugging environment in Aptana: http://docs.aptana.com/docs/index.php/Developing_with_the_Aptana_PHP_Plugin Xdebug website:http://xdebug.org/

More Related Content

What's hot

Installing php 7.4 Nginx Laravel 7.x on Centos 8
Installing php 7.4 Nginx Laravel 7.x on Centos 8Installing php 7.4 Nginx Laravel 7.x on Centos 8
Installing php 7.4 Nginx Laravel 7.x on Centos 8Raja Rozali Raja Hasan
 
Installation of Drupal on Windows XP with XAMPP
Installation of Drupal on Windows XP with XAMPPInstallation of Drupal on Windows XP with XAMPP
Installation of Drupal on Windows XP with XAMPPRupesh Kumar
 
8 Web Practices for Drupal
8  Web Practices for Drupal8  Web Practices for Drupal
8 Web Practices for DrupalWingston
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Boxguest34a3a419
 
Installation of Drupal on Windows XP
Installation of Drupal on Windows XPInstallation of Drupal on Windows XP
Installation of Drupal on Windows XPRupesh Kumar
 
Installing symfony within netbeans and WAMP
Installing symfony within netbeans and WAMPInstalling symfony within netbeans and WAMP
Installing symfony within netbeans and WAMPRiyad Bin Zaman
 
How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.Web Visitors
 
Ilias 4 # clients - On shared hosting with cPanel
Ilias 4 # clients - On shared hosting with cPanelIlias 4 # clients - On shared hosting with cPanel
Ilias 4 # clients - On shared hosting with cPanelleer_thuiz_com
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlinkusha kannappan
 
PHP on Google App Engine
PHP on Google App EnginePHP on Google App Engine
PHP on Google App Enginetim4h0blyn
 
Build website in_django
Build website in_django Build website in_django
Build website in_django swee meng ng
 
Introduzione ai test automatici con PHPunit
Introduzione ai test automatici con PHPunitIntroduzione ai test automatici con PHPunit
Introduzione ai test automatici con PHPunitFabio Giannese (Diodœ)
 
The Critical Path for Startups
The Critical Path for StartupsThe Critical Path for Startups
The Critical Path for StartupsMichael Herlache
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XPRupesh Kumar
 
Instruction Sheet to Setup CI
Instruction Sheet to Setup CIInstruction Sheet to Setup CI
Instruction Sheet to Setup CIvodQA
 
Installing php and my sql locally using xampp
Installing php and my sql locally using xamppInstalling php and my sql locally using xampp
Installing php and my sql locally using xampppeyman Ghader Kurehpaz
 

What's hot (20)

Installing php 7.4 Nginx Laravel 7.x on Centos 8
Installing php 7.4 Nginx Laravel 7.x on Centos 8Installing php 7.4 Nginx Laravel 7.x on Centos 8
Installing php 7.4 Nginx Laravel 7.x on Centos 8
 
Installation of Drupal on Windows XP with XAMPP
Installation of Drupal on Windows XP with XAMPPInstallation of Drupal on Windows XP with XAMPP
Installation of Drupal on Windows XP with XAMPP
 
8 Web Practices for Drupal
8  Web Practices for Drupal8  Web Practices for Drupal
8 Web Practices for Drupal
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
 
Installation of Drupal on Windows XP
Installation of Drupal on Windows XPInstallation of Drupal on Windows XP
Installation of Drupal on Windows XP
 
Installing symfony within netbeans and WAMP
Installing symfony within netbeans and WAMPInstalling symfony within netbeans and WAMP
Installing symfony within netbeans and WAMP
 
How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.
 
Ilias 4 # clients - On shared hosting with cPanel
Ilias 4 # clients - On shared hosting with cPanelIlias 4 # clients - On shared hosting with cPanel
Ilias 4 # clients - On shared hosting with cPanel
 
Laravel error
Laravel errorLaravel error
Laravel error
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlink
 
PHP on Google App Engine
PHP on Google App EnginePHP on Google App Engine
PHP on Google App Engine
 
Build website in_django
Build website in_django Build website in_django
Build website in_django
 
Introduzione ai test automatici con PHPunit
Introduzione ai test automatici con PHPunitIntroduzione ai test automatici con PHPunit
Introduzione ai test automatici con PHPunit
 
The Critical Path for Startups
The Critical Path for StartupsThe Critical Path for Startups
The Critical Path for Startups
 
CakePHP and AJAX
CakePHP and AJAXCakePHP and AJAX
CakePHP and AJAX
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XP
 
Flask
FlaskFlask
Flask
 
Instruction Sheet to Setup CI
Instruction Sheet to Setup CIInstruction Sheet to Setup CI
Instruction Sheet to Setup CI
 
Apache
ApacheApache
Apache
 
Installing php and my sql locally using xampp
Installing php and my sql locally using xamppInstalling php and my sql locally using xampp
Installing php and my sql locally using xampp
 

Similar to Setting up a debugging environment for Drupal

An Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPressAn Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPressKayleigh Thorpe
 
PHP: Debugger, Profiler and more
PHP: Debugger, Profiler and morePHP: Debugger, Profiler and more
PHP: Debugger, Profiler and moreVõ Duy Tuấn
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Getting started with PHPUnit
Getting started with PHPUnitGetting started with PHPUnit
Getting started with PHPUnitKhyati Gala
 
How to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on WindowsHow to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on WindowsRizban Ahmad
 
PHP Error installing During Magento 2
PHP Error installing During Magento 2PHP Error installing During Magento 2
PHP Error installing During Magento 2Tecstub
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsDECK36
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestJoshua Warren
 
Drupal Development w/ PhpStorm and Xdebug
Drupal Development w/ PhpStorm and XdebugDrupal Development w/ PhpStorm and Xdebug
Drupal Development w/ PhpStorm and XdebugChris Haynes
 
Doc quickinstall 3.x
Doc quickinstall 3.xDoc quickinstall 3.x
Doc quickinstall 3.xsetankecos
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows BoxJayanta Dash
 
PHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for phpPHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for phpaimaq9a
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$Joe Ferguson
 

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

PHP
PHPPHP
PHP
 
An Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPressAn Introduction to Xdebug for WordPress
An Introduction to Xdebug for WordPress
 
PHP: Debugger, Profiler and more
PHP: Debugger, Profiler and morePHP: Debugger, Profiler and more
PHP: Debugger, Profiler and more
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Getting started with PHPUnit
Getting started with PHPUnitGetting started with PHPUnit
Getting started with PHPUnit
 
How to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on WindowsHow to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on Windows
 
PHP Error installing During Magento 2
PHP Error installing During Magento 2PHP Error installing During Magento 2
PHP Error installing During Magento 2
 
Php Debugger
Php DebuggerPhp Debugger
Php Debugger
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
 
Drupal Development w/ PhpStorm and Xdebug
Drupal Development w/ PhpStorm and XdebugDrupal Development w/ PhpStorm and Xdebug
Drupal Development w/ PhpStorm and Xdebug
 
Doc quickinstall 3.x
Doc quickinstall 3.xDoc quickinstall 3.x
Doc quickinstall 3.x
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
 
Phalcon - Giant Killer
Phalcon - Giant KillerPhalcon - Giant Killer
Phalcon - Giant Killer
 
PHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for phpPHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for php
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Php
PhpPhp
Php
 
Php
PhpPhp
Php
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Setting up a debugging environment for Drupal

  • 1. Debugging Drupal Setting up a local development environment
  • 2. Tools of the Trade Web server solution stack Windows: XAMPP Mac: MAMP Integrated development environment (IDE) Aptana Web browser Firefox + add-ons
  • 3. Step 1: Set up your server MAMP 1.8.3 XAMPP 1.7.1 (older version with PHP 5.2) from Sourceforge: http://sourceforge.net/projects/xampp/files/
  • 4. Step 1: Edit PHP settings Find php.ini MAMP: /Applications/MAMP/conf/PHP5/php.ini XAMPP: c:amppHPhp.ini error_reporting = E_ALL display_errors = On display_startup_errors = on log_errors = on error_log = “/path/to/php_error.log”
  • 5. Step 1: Edit PHP settings Find [xdebug] section towards the end of the file Uncomment the line zend_extension=… by removing the semicolon Add the following parameters after that line: xdebug.remote_enable=1 xdebug.remote_handler="dbgp" xdebug.collect_params=3 xdebug.show_local_vars=On xdebug.dump_globals=On xdebug.show_exception_trace=On xdebug.remote_mode=req xdebug.idekey=default Find [Zend] section Comment the line zend_extension=… by prepending a semicolon
  • 6. Step 1: Verify changes Restart *AMP Get to the php info page (via Devel module or *AMP website)
  • 7. Step 2: Set up Aptana Download and install Aptana Studio from http://www.aptana.org/studio/download (standalone, full installer) Install PDT SDK 2.1.2 Set up your workspace File > New Project… PHP > PHP Project
  • 8. Step 2: Set up Aptana Aptana Studio > Preferences > PHP > Debug > Default Settings group panel Set debugger to Xdebug Click Configure, ensure Xdebug is on port 9000 Click “PHP Executables…”, then “Add…” Add a new PHP executable which points to *AMP’s php executable (/Applications/MAMP/bin/php5/bin/php, c:amppin.. and the php.ini file (/Applications/MAMP/conf/php5/php.ini) Click OK Return to the group panel and verify that the PHP executable is set Restart the server
  • 9. Step 2: Set up Aptana Associate Drupal file extensions as PHP files Preferences > General > Content Types Within Content Types > Text select PHP Content Type and add *.module and *.install Preferences > General > Editors > File Associations Add *.module and *.install extension Under Associated editors selected PHP editor and click Default
  • 10. Step 2: Set up Aptana Add the PHP debug perspective
  • 11. Step 3: Set up Firefox Install Xdebug Helper add-on: https://addons.mozilla.org/en-US/firefox/addon/3960 Toggle Xdebug session Toggle Xdebug profiler
  • 12. Step 3: Set up Firefox Default configuration for add-on should be fine
  • 13. Presto! Ensure Firefox is not working in offline mode Toggle on the Xdebug session Reload the page
  • 14. Printing out variables From 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 Resources About Xdebug Helper Firefox add-on: http://code.google.com/p/syslogr-utils/wiki/XdebugHelper Settings up a debugging environment in Aptana: http://docs.aptana.com/docs/index.php/Developing_with_the_Aptana_PHP_Plugin Xdebug website:http://xdebug.org/