How to allow Zend Optimizer and Zend Debugger coexist

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:

  1. download latest 5.2.10 Zend Debugger here
  2. 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
  3. point zend_extension_manager.debug_server_ts to the parent folder of php-m.n.x
  4. 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!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值