The Software Management Blog
Optimizing Software Development
-
PHP 101: Setting-up an Environment for Development and Debugging
Posted on February 8th, 2008 No commentsAfter years of developing “enterprise” [read:big and bulky] software you are tired from the whole shebang J2EE/.NET and you are now looking for easy lightweight web development. PHP can be one of your choices.
How do you start? Easy, just follow these steps to quickly setup a development environment with all servers, IDE and a debugger. In a few quick steps you will be able to setup:
- XAMPP which comes with:
- Apache
- PHP 5.2.x
- MySQL 5.0.45
- Mercury Server (SMTP, FTP, etc.)
- Zend Studio for Eclipse
Let’s start:
- Download XAMPP 1.6.5 for Windows from http://www.apachefriends.org/en/xampp-windows.html#641
- Follow the intuitive setup wizard to install
- Download Zend Studio for Eclipse from http://www.zend.com/en/products/studio/
- Install Zend Studio
- To enable the Zend Debugger first navigate to XAMPP_HOME\php\zendOptimizer\lib and create a new folder Debugger. Create a new folder php-5.2.x under Debugger.
- Copy ZendStudio_HOME\plugins\ org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\ resources\php5\ZendDebugger.dll to XAMPP_HOME\php\zendOptimizer\lib\Debugger\php-5.2.x
-
Open XAMPP_HOME/apache/bin/php.ini and add disable the Zend Optimizer while enabling the Zend Debugger:
[Zend]
zend_extension_ts = "XAMPP_HOME\php\zendOptimizer\lib\ZendExtensionManager.dll"
;zend_extension_manager.optimizer_ts = "XAMPP_HOME\php\zendOptimizer\lib\Optimizer"
;zend_optimizer.enable_loader = 1
;zend_optimizer.optimization_level=15
;zend_optimizer.license_path = "XAMPP_HOME\php\zendOptimizer\lib"
zend_extension_manager.debug_server_ts = "XAMPP_HOME\php\zendOptimizer\lib\Debugger"
zend_debugger.allow_hosts = 127.0.0.1
zend_debugger.expose_remotely = always - To verify the debugger, navigate to http://localhost/xampp and click the phpinfo() link. You should see the Zend Debugger information on the page such as
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Debugger v5.2.12, Copyright (c) 1999-2007, by Zend Technologies
- In Zend Studio, create a PHP project or use the sample project to start debugging
- Keep in mind that Zend Studio has two debugging modes: local and remote. In this example both are enabled. If you selected to install the Zend Firefox extension you can launch a debug session right from Firefox. Nifty.


