* RELEASE: Set next development version |
||
|---|---|---|
| .. | ||
| che-plugin-zend-debugger-ide | ||
| che-plugin-zend-debugger-server | ||
| README.md | ||
| pom.xml | ||
README.md
Zend Debugger for PHP
Support for debugging applications that runs on PHP with Zend Debugger on board.
Requirements
Zend Debugger is a PHP extension that needs to be installed and enabled in the PHP distribution available in the Che stack. If you decide to use ZEND stack to create your workspace you can skip "Zend Debugger Installation" part as Zend Debugger is already installed in ZEND stack's PHP. If you decide to use default PHP stack to create a workspace, you will have to follow the instructions from the next chapter to install Zend Debugger extension.
Zend Debugger Installation
The following steps have to be carried out to install Zend Debugger in Che's default PHP stack.
- Create new workspace with the use of PHP stack from the Ready-to-go Stacks list
- Download Zend Studio Web Debugger - PHP 5.5 and PHP 5.6 (64 bit) package from Zend Downloads
- Add ZendDebugger.so file from downloaded package to /usr/lib/php5/20131226
- To enable debugging applications in CLI mode, add the following entry in /etc/php5/cli/php.ini file:
zend_extension=ZendDebugger.so; - To enable debugging applications in WEB mode, add the following entries in /etc/php5/apache2/php.ini file:
zend_extension=ZendDebugger.so;
opcache.enable=0;
Getting Started
To be able to debug PHP code, you have to start Zend Debugger client in Che and run your PHP Web/CLI application with the use of some additional parameters that are required to trigger debug session in PHP. In case of debugging PHP Web applications you can use the tools like Z-Ray (available in ZEND stack) or Zend Debugger Toolbar for Firefox to trigger debug session without need to add debug parameters to URL that runs your PHP application.
Starting debug client in Che:
- Go to Run -> Edit Debug Configurations...
- Create new PHP - ZEND DEBUGGER configuration with default settings
- Press Debug button to start Zend Debugger client
Starting debug session in CLI mode:
- Use
cd <your-php-app-dir>command in terminal - Run PHP script in terminal with the use of the following command:
QUERY_STRING="start_debug=1&debug_host=localhost&debug_port=10137" php <your-php-app>.php
Starting debug session in Web mode:
- Start Che's local PHP server with your project on board
- Open the following URL in a browser:
<your-php-app-URL>?start_debug=1&debug_host=localhost&debug_port=10137
Starting debug session in Web mode with Z-Ray (ZEND stack only):
- Open an URL in a browser that runs your PHP application in the Che's local Zend Server
- Use one of the commands for starting debug session available in Z-Ray toolbar (bug icon) i.e. Debug Current Page
Starting debug session in Web mode with Zend Debugger Toolbar for Firefox:
- Install Zend Studio Browser Toolbars - Firefox from Zend Downloads
- Open an URL in a Firefox browser, that runs your PHP application in the Che's local server
- Use one of the commands for starting debug session available in Zend Debugger toolbar (bug icon) i.e. Debug Current Page
Happy PHPing!