Tuesday, April 29, 2008

How to enable Zend Optimizer in XAMPP?


If you just plan to install a PHP application but it keep prompt error when you run install.php, I think you either need to install Zend Optimizer or enable it.

If you are using XAMPP, you may simply uncomment some lines in a couple files to enable the Zend Optimizer.

XAMPP has 2 php.ini files, one in C:\xampp\apache\bin folder and another in C:\xampp\php folder. To enable Zend Optimizer in XAMPP, you need to locate the one in C:\xampp\apache\bin and double-click on it. This should bring up notepad with php.ini
Scroll down to the bottom of the file and you will see a [Zend] section. That will look something like this:

; [Zend]
; zend_extension_ts = "\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
; zend_extension_manager.optimizer_ts = "\xampp\php\zendOptimizer\lib\Optimizer"
;zend_optimizer.enable_loader = 0
; zend_optimizer.optimization_level=15

Uncomment each line by removing the semi-colon ; at the begining. The result should look something like this:

[Zend]
zend_extension_ts = "\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
zend_extension_manager.optimizer_ts = "\xampp\php\zendOptimizer\lib\Optimizer"
zend_optimizer.enable_loader = 0
zend_optimizer.optimization_level=15


The paths and file names may vary. But this is not a problem, just simply remove the semicolon.

NOTE: In some versions of XAMPP these lines may already be uncommented, however you must change the line:
zend_optimizer.enable_loader = 0
to
zend_optimizer.enable_loader = 1

Next you should do the same thing for the php.ini file located in C:\xampp\php folder.
Restart XAMPP’s control panel and the Zend Optimizer is now enabled!

No comments: