
Install xDebug on Zend Server 5.1 and Windows 7
I’m used to installing everything separately from day one. Never used WAMP or Denver. Starting with PHP / FI, I always set everything separately. Well, of course, and xDebug which has been said a lot. Just peep over the hub and you will find many articles about what xDebug can do, even profile ready-made code that I personally really like.
But lately, we at the company have been building our solutions on the Zend Framework. Which led us to a closer use of other Zend technologies like Zend Server or Zend Studio. I would never start using WAMP or Denver, but Zend Server is different. It does not install MySQL. Allows you to quickly manage PHP on and off extensions, or monitor performance. And this is really a powerful tool, but it's not about him.
Not everyone likes the built-in Zend Debug engine that ships with Zend Server as the default debugging tool. Therefore, I decided to replace it with my usual xDebug. But I was surprised that I had to spend a lot of time installing xDebug on Zend Server. And although Google produces a huge number of articles on how to do this, nevertheless, I had to read several of them, and spend almost 1 hour on what should have taken 5-10 minutes. That is why I decided to cover this topic in detail.
1. Download the xDebug extension for PHP
At this stage, it is important to understand what exactly needs to be downloaded. When downloading, consider the following data
* It must be VC9 for Windows 7
* The extension must not contain TS in the name
* The file name must have the version of PHP installed on your Zend Server. This is 5.2 or 5.3
* Even if you have a 64-bit system, Zend Server is still installed as a 32-bit environment. So choose only 32 bits.
You will download a file like php_xdebug-2.1.0-5.3-vc9-nts.dll.
2. Save this file in the Zend Server PHP libraries. Usually this is folder
3. Now you need to disable Zend Debug so that they do not interfere with each other. Actually, I don’t even know whether they will work together, the detailed answer to this question will not only be with the data or not, but why, I would love to read it in the comments.
To disconnect, open the Zend Debug configuration file and comment out the term in it.
to do this, simply precede this line with a dot and a comma;
This file is usually located here.
4. Now open the php.ini file which is usually nahodtsya here
and right in front of a group of settings [zend] insert Please note that this code is inserted is not in front of the line as it is usually advisable, namely to a group of settings indicated by square brackets [zend] Let me be clear, what have we done. The first term loads the xDebug extension itself. Do not forget to change the file name but the one you download. xdebug.profiler_enable
- prohibits permanent profiling. Instead, we will only use profiling for individual script launches when we need it.
xdebug.profiler_output_dir is the path where profile files will be created which can then be viewed and analyzed using WinCacheGrind .
xdebug.profiler_enable_trigger - this parameter allows us to enable profiling only if we add the XDEBUG_PROFILE parameter to POST, GET or COOKIE. Look also for FireFox and Chrome there are extensions that allow this to be controlled.
5. All that remains is to reboot Apache and check in PHP Info that xDebug was loaded successfully.

But lately, we at the company have been building our solutions on the Zend Framework. Which led us to a closer use of other Zend technologies like Zend Server or Zend Studio. I would never start using WAMP or Denver, but Zend Server is different. It does not install MySQL. Allows you to quickly manage PHP on and off extensions, or monitor performance. And this is really a powerful tool, but it's not about him.
Not everyone likes the built-in Zend Debug engine that ships with Zend Server as the default debugging tool. Therefore, I decided to replace it with my usual xDebug. But I was surprised that I had to spend a lot of time installing xDebug on Zend Server. And although Google produces a huge number of articles on how to do this, nevertheless, I had to read several of them, and spend almost 1 hour on what should have taken 5-10 minutes. That is why I decided to cover this topic in detail.
1. Download the xDebug extension for PHP
At this stage, it is important to understand what exactly needs to be downloaded. When downloading, consider the following data
* It must be VC9 for Windows 7
* The extension must not contain TS in the name
* The file name must have the version of PHP installed on your Zend Server. This is 5.2 or 5.3
* Even if you have a 64-bit system, Zend Server is still installed as a 32-bit environment. So choose only 32 bits.
You will download a file like php_xdebug-2.1.0-5.3-vc9-nts.dll.
2. Save this file in the Zend Server PHP libraries. Usually this is folder
C:\Program Files\Zend\ZendServer\lib
3. Now you need to disable Zend Debug so that they do not interfere with each other. Actually, I don’t even know whether they will work together, the detailed answer to this question will not only be with the data or not, but why, I would love to read it in the comments.
To disconnect, open the Zend Debug configuration file and comment out the term in it.
zend_extension_manager.dir.debugger="C:\Program Files\Zend\ZendServer\lib\debugger"
to do this, simply precede this line with a dot and a comma;
This file is usually located here.
C:\Program Files\Zend\ZendServer\etc\cfg\debugger.ini
4. Now open the php.ini file which is usually nahodtsya here
C:\Program Files\Zend\ZendServer\etc\php.ini
and right in front of a group of settings [zend] insert Please note that this code is inserted is not in front of the line as it is usually advisable, namely to a group of settings indicated by square brackets [zend] Let me be clear, what have we done. The first term loads the xDebug extension itself. Do not forget to change the file name but the one you download. xdebug.profiler_enable
[xdebug]
zend_extension="C:\Program Files\Zend\ZendServer\lib\php_xdebug-2.1.2-5.3-vc9-nts.dll"
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = "D:\www\xdebug"
xdebug.profiler_enable_trigger = 1
zend_extension="C:\Program Files\Zend\ZendServer\lib\ZendExtensionManager.dll"
- prohibits permanent profiling. Instead, we will only use profiling for individual script launches when we need it.
xdebug.profiler_output_dir is the path where profile files will be created which can then be viewed and analyzed using WinCacheGrind .
xdebug.profiler_enable_trigger - this parameter allows us to enable profiling only if we add the XDEBUG_PROFILE parameter to POST, GET or COOKIE. Look also for FireFox and Chrome there are extensions that allow this to be controlled.
5. All that remains is to reboot Apache and check in PHP Info that xDebug was loaded successfully.
