Setting up debugging in an IDE with a local PHP development environment has gotten so easy it can be done in a couple automated steps. In this post I will demonstrate how to get step debugging functioning with Zend Studio and Zend Debugger when the server is set up on a local environment.
To begin with, I had the following:
- Local installation of Zend Server 8.5.+ (basic LAMP stack, but with Zend Debugger included in the Zend Server installation). Alternatively I could have had a vanilla LAMP environment with Xdebug.
- Ensure that Z-Ray is active in the Zend Server settings.
- A local project set up on Zend Studio, without the server set up in the Zend Studio project configuration. (in this example I have a Zend Expressive Skeleton ready)
- The local project set up as an Apache virtualhost.
Ensure Zend Studio is running with the project we will debug open.
In a browser with the application rendered I click the debug icon in the Z-Ray toolbar at the foot of the window, and select the desired debugging action.
This will cause Zend Studio to prompt if we desire to use the Debug Perspective after it receives the debug connection from Zend Debugger. In most cases we can simply click Yes and let things happen normally.
That’s about it, we are debugging!
This was a very simplistic local development environment setup. We didn’t have a firewall to contend with, and the server was set up locally rather than inside a virtual machine. I have other posts, linked below, to help with some of these alternative setups.
Other posts on Debugging you may find helpful:
I had a need to connect to MSSQL using PHP version 5 from a CentOS 5 server. To do this I needed FreeTDS and the module mssql in PHP. After a diligent search I found that there was no quick and easy way to install the mssql module, like “up2date install php-gd” to get GD to work from PHP.
I found a few places that had ideas and hints to make this work, but finally used the directions I found at http://www.howtoforge.com/installing_php_mssql_centos5.0 (slightly altered to fit my means) and will duplicate here so I can easily find it later.
At first I thought I needed to recompile PHP, but as it turned out I only needed to pre-compile it so that I could fetch the mssql.so, and then manually edit the php.ini to use it.
Continue reading Adding mssql capability to PHP5 on CentOS
I found documentation very sparse on the subject of using JOIN with the Zend Framework. So i set out on a quest of many hours figuring out how to get it to work. Here is what I ended up with.
I do not claim that this is the best way to do it, or that it is correct, but here is how I solved this and got JOIN working within Zend Framework.
Continue reading Using JOIN within the Zend Framework
I recently realized a few things that I didn’t know about the Zend Studio IDE. As many know I have used the Zend Studio IDE for PHP development for some time. All along I have been using the templates built into the IDE, and never realized that they could be changed since I had no need. My coding standard for years has been the same as the default templates built into the Zend Studio. However, my new employer has a large percentage of coders using Vi who had a different standard in relation to white space than I did, and they were not open to changing their coding standard to meet my Zend Studio preference.
So I had a dilemma. How could I continue to produce speedy PHP using the IDE if I had to type out functions, classes, and “if” statements 100%? (I feel that I save a significant amount of time using the template auto complete shortcuts.) The alternative was to continually edit these constructs after allowing the code completion to insert them.
Continue reading Zend Studio IDE knowledge nuggets!