PHP Accelerator is an easily installed PHP Zend engine extension that provides a PHP cache, and is capable of delivering a substantial acceleration of PHP scripts without requiring any script changes, loss of dynamic content, or other application compromises.
-
Installation:
-
Download PHPAccelerator.
Unpackage it and move contents to "/usr/local/phpaccelerator".
Include the below line to php.ini under dynamic extension section:
zend_extension="/usr/local/phpaccelerator/php_accelerator_1.3.3r2.so"Restart httpd process Testing:
-
Create and execute the below script:
<? var_dump($GLOBALS['_PHPA']); ?>If PHPA is installed then there should be output, and if enabled, you should see output similar to the following:
array(3) { ["ENABLED"]=> bool(true) ["iVERSION"]=> int(10303) ["VERSION"]=> string(7) "1.3.3r2" }You can also check if it works at:
http://www.rexswain.com/httpview.html
Enter the url of a php page on your server. The header information should show "X-Accelerated-By:·PHPA/1.3.3r2
Configurations:phpa.shm_size = 32To access the memory usage, you will need to add the user and group that apache runs as to the "php.ini" file and restart apache.
phpa.shm_user = apacheuser phpa.shm_group = apachegroupYou should see output of `phpa_cache_admin -mv` similar to the following:
shm size 8.0MB bytes mempool size 8.0MB mempool bytes allocated 947.4KB mempool max bytes allocated 961.8KB mempool bytes free 7.0MB mempool overhead 42.2KB cache enabled
This says that the shared memory is 8MB, that 947KBytes is allocated now, and that the maximum ever allocated was nearly 962KBytes. From this information you might decide to reduce or increase the size of the cache. If the maximum ever allocated is nearly the same as the cache size then you should probably increase the size. 2MB more than the maximum used should
be a comfortable setting
For more information, check out the README and CONFIGURATION files that come with the download.