Debugging in PhpStorm Using Zend Server
Zend Server's integration with PhpStorm allows you to easily debug your applications and quickly identify those weak spots in your code. Using Z-Ray, you can directly debug or profile your applications in PhpStorm, allowing you to see how your code is running as you develop it, and empowering you to deliver higher-quality code faster.
Tutorial Content
In this tutorial you will learn:
- To create a new project in PhpStorm from existing files
- Configure PhpStorm to debug with Zend Server
- Debug/profile the application from Z-Ray
Prerequisites
-
Download and install Zend Server 8.x or above from the Zend Server Downloads page . For detailed installation instructions, see the Zend Server Installation Guide: DEB / RPM / SLES / Mac OS X / Windows
-
Download and install PhpStorm Early Access version from JetBrains.
- Download WordPress from WordPress.org and install it on the root directory of your Web server. For detailed instructions, see this tutorial: http://www.siteground.com/tutorials/wordpress/wordpress-installation.htm.
To better understand the procedures described in this topic, watch this video:
Our first step is to create a new project in PhpStorm from the existing WordPress files we installed on the root directory of our Web server.
|
|
|
To create a new project in PhpStorm:
|
Can't see Z-Ray? Make sure Z-Ray is enabled from the Configurations | Z-Ray page in the Zend Server UI. For more information, see Enabling/Disabling Z-Ray. If you still can’t see Z-Ray, there may be a connectivity issue. For more information, see Troubleshooting Connectivity Issues. |
Before we begin debugging, we need to make sure PhpStorm is configured correctly for integration with Zend Server. In most cases, the default configurations in PhpStorm will suffice and no further action is required.
|
|
|
To configure PhpStorm:
|
|
We're now going to insert some faulty code to simulate errors in our application, and then initiate a debugging session in PhpStorm from Z-Ray.
Inserting Example Code
This step includes the example code for simulating errors in the WordPress application.
|
|
|
To insert example code:
|
|
Debugging from Z-Ray
|
|
|
To debug/profile your from Z-Ray:
|
|