How to allow Zend Optimizer and Zend Debugger coexist
January 13th, 2008
One php script that I used was encoded with Zend so I must enable Zend optimizer to run those scripts on my web server, yeah, as any smart people would guess, Zend optimizer should run smoothly with Zend Debugger, after all, they are all made by Zend, right? Turns out I was wrong.
I got this message after I enabled both Zend optimizer and Zend debugger: (I was using xampp with php 5.2.4)
PHP Fatal error: [Zend Optimizer] Zend Debugger must be loaded after Zend Optimizer in Unknown on line 0
The php.ini was configured this way
zend_extension_ts = “E:\xamp\php\zendOptimizer\lib\ZendExtensionManager.dll”
zend_extension_manager.optimizer_ts = “E:\xamp\php\zendOptimizer\lib\Optimizer”
zend_extension_ts = “e:\xamp\php\ext\ZendDebugger.dll”
After some research, turns out the default suggested configuration was wrong, you must use a hidden arg zend_extension_manager.debug_server_ts and point it to a container directory that names its children directory with a name pattern “php-n.m.x”.
Here is the steps,
- download latest 5.2.10 Zend Debugger here
- unzip the downloaded zip file to your web host, rename the children directory from m_n_x_comp to php-m.n.x, i.e. change 5_2_x_comp to php-5.2.x
- point zend_extension_manager.debug_server_ts to the parent folder of php-m.n.x
- enable optimizer in the same way
so completed php.ini should have something like this.
zend_extension_ts = “c:\xamp\php\zendOptimizer\lib\ZendExtensionManager.dll”
zend_extension_manager.optimizer_ts = “c:\xamp\php\zendOptimizer\lib\Optimizer”
zend_extension_manager.debug_server_ts=c:\xamp\zend-5.2.10
zend_debugger.expose_remotely=allowed_hosts
zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.0/255
zend_debugger.allow_tunnel=127.0.0.1/32
Now start your apache and have fun!
Entry Filed under: IT (geeky)
17 Comments Add your own
1. Anonymous | April 7th, 2008 at 3:10 am
This worked like a charm, thanks a ton!!
2. Marco | May 1st, 2008 at 11:29 am
Many thanks, this saved me!
3. Rick | May 5th, 2008 at 1:25 am
What occurs is Apache will select the appropriate version according to the version of PHP running.
If you look at the “\lib\zendOptimizer” directory you will see entries for various versions of PHP such as 4.1.x,…,… 5.2.x
The debugger is no different… So if you create a directory under PHP\lib\zendOptimizer called say “debug” giving you “PHP\lib\zendOptimizer\debug” under that debug directory create your version directories such as php-5.2.x JUST LIKE THAT.
Do not go like, “php-5.2.5″ you want it as “php-5.2.x” ie: dont fill in the “x” with a actual version. The MINOR VERSION in other words is ignored.
You now have a path of “PHP\lib\zendOptimizer\debug\php-5.2.x”
Save your ZendDebugger.dll FOR VERSION 5.2.n into that directory.
In your php.ini which in the case of Xampp resides in your Xampp\apache\bin directory add:
zend_extension_manager.debug_server_ts=”"PHP\lib\zendOptimizer\debug”
zend_debugger.expose_remotely=allowed_hosts
zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.0/255
zend_debugger.allow_tunnel=127.0.0.1/32
***NOTE*** No TRAILING “\” after debug and NOTE your not mentioning the php-5.2.x directory. These will be automatically selected based on WHAT version of PHP your running.
4. Rick | May 5th, 2008 at 1:28 am
Oye Vey
zend_extension_manager.debug_server_ts=”C:\xampp\php\zendOptimizer\lib\debug”
zend_debugger.expose_remotely=allowed_hosts
zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.0/255
zend_debugger.allow_tunnel=127.0.0.1/32
5. Matt | June 20th, 2008 at 5:27 pm
Here is what I have tried using the php.ini file located within c:\xampp\apache\bin\ with no success:
[Zend]
zend_extension_ts = “C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll”
zend_extension_manager.optimizer_ts = “C:\xampp\php\zendOptimizer\lib\Optimizer”
zend_optimizer.enable_loader = 0
zend_optimizer.optimization_level=15
[Zend DEBUGGER]
zend_extension_manager.debug_server_ts = “c:\xamp\php\zendDebugger”
zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.0/255
zend_debugger.expose_remotely=allowed_hosts
I have placed the DUMMY.php file within the c:\xampp\htdocs\ root directory and the zendDeugger is located within the debug_server_ts directory.
Please help!
6. Ashley Raiteri | June 25th, 2008 at 7:28 am
Seriously, Thanks, saved me hours of trouble.
7. Brad Baumann | July 9th, 2008 at 6:22 pm
You saved me HOURS too. Thank you!
8. Nikita Volkov | July 16th, 2008 at 7:37 am
Thank you very much!
9. Arya Sabda | July 23rd, 2008 at 2:21 am
Thanks for the clue, but my phpinfo() didn’t show that Zend Debugger was loaded. Just Zend Extension manager and Zend Optimizer. Altough apache logs wasn’t complaining about the dll (I was using XAMPP for windows)
like this
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
Any
10. Mindaugas | August 6th, 2008 at 2:51 am
exactly, you dont’t need exact version of php under X. This is worng:
zend_extension_manager.debug_server_ts=c:\xamp\zend-5.2.10
Any way, thank you!
11. Lucas | August 17th, 2008 at 7:45 pm
Rick’s solution worked for me. Thanks a lot!
12. Lou | August 22nd, 2008 at 8:51 pm
I was having the same problem as Matt and Arya until I noticed in my phpinfo():
Loaded Configuration File C:\xampp\apache\bin\php.ini
I’d been editing c:\xampp\php\php.ini!!! I copied the configuration lines across to the php.ini file under the apache folder and everything fell into place.
phpinfo() is displaying the Zend Debugger v5.2.14 info, and the “Test Debugger” test from within Eclipse is working.
thanks for the post(s) everyone.
13. Anthony | October 7th, 2008 at 8:53 am
Thanks very much for this very usefull post ! you really made me save time !
14. Ro | October 10th, 2008 at 12:24 pm
Small correction:
zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.0/255 (originally rather /255.255.255.0)
will be misinterpreted by the debugger. The correct subnet mask is between 1 and 32:
zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.0/24
15. Daniel | November 7th, 2008 at 5:06 am
Wow, you really saved my day. Thanks alot!
16. Rima | December 2nd, 2008 at 9:45 pm
Man, you really saved me a lot of time and a lot of hours of grief and aggravation, not to mention fights with the boyfriend who could not do the installation. Thanks a lot!
17. Grover Campos | December 17th, 2008 at 9:27 am
A lot of thanks, your post is very helpfull
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed