http://php-accelerator.co.uk/ can be downloaded and is a strong opponent of zend. It's free. I'm already using it. The effect is not bad.
Modify PHP.ini and add:
zend_extension = /usr/local/lib/php_accelerator_1.3.3r2.so
phpa = on
phpa.tweaks = on
phpa.cache_dir = /tmp
phpa.file_perms = 400
phpa. cache_file_prune_period = 1h
phpa.cache_file_ttl = 1d
phpa.shm_size = 10
phpa.shm_key = 0xc0deb00
phpa.shm_perms = 666
phpa.shm_user = nobody
phpa.shm_group = nobody
phpa.shm_release_at_exit = on
phpa.shm_stats_check_period = 5m
phpa.shm_ttl = 12h
phpa.shm_max_processes = 512
phpa.shm_lock_threshold0 = 10
apachectl graceful can be used. See its documentation for specific parameters.
We have explained several methods of acceleration in the article "LAMP Acceleration", among which we mentioned PHP Accelerator. Its installation method is very simple, but you need to go to its website to obtain an activation key.
1. Download:
www.php-accelerator.co.uk/download.php
2. Obtain the activation key and install:
www.php-accelerator.co.uk/activate.php
After registering your own SERVER_NAME, you You will get the following prompt:
Your key for www.freelamp.com is 8edfd13946c96309244fcca309415902 Now you must set the key for www.freelamp.com in your site configuration.
For single domains not using virtual hosts
The key can be set in the php.ini file as follows:
#PHPA key for www.freelamp.com
#
phpa.registration_key = 8edfd13946c96309244fcca309415902
For domains setup as a virtual host
Add the key to the domain specific section for your web server.
# www.freelamp.com VHost entry
#
ServerName www.freelamp.com
# ... (other vhost specific config)
# php settings
php_value phpa.registration_key 8edfd13946c96309244fcca309415902
# also enable phpa if set to off in the php.ini (the default is on)
php_value phpa 1
For the specific phpa value setting, you can refer to the configuration of the CONFIGURATION file that comes with the software.
Since most websites are configured with virtual hosts, it is recommended to use php_value phpa.
For example:
php_value phpa.tweaks off
php_value phpa.cache_dir /tmp
php_value phpa.file_perms 400
php_value phpa.ignore_files "/index.php, /a/test.php"
# php_value phpa .ignore_dirs "/data/ WWW/site1/,/cache/"
php_value phpa.shm_size 8
php_value phpa.shm_key 0xc0deb00
php_value phpa.shm_perms 664
3. Set up php.ini
Assume we unzip the downloaded file to /usr/local/ php, then add in php.ini:
zend_extension=/usr/local/php/php_accelerator_1.2p2.so
And comment out the original Zend optimization engine:
# zend_extension=/usr/local/Zend/lib/ZendOptimizer. so
Restart Apache and use a browser to browse any PHP page. You can see that some files starting with phpa are generated under /tmp. Another way to check whether buffering is working is to look at the output of phpinfo(). The description part of the original Zend optimization engine has been displayed as:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
with the PHP Accelerator v1.2p2, Copyright (c) 2001-2002, by Nick Lindridge
It should be noted that the method of installing INSTALL installation instructions, the .so file and the actual The .so files are different, so you need to pay attention to this difference when installing.
IV. Adjust the buffer size
PHP Accelerator provides buffer management commands:
phpa_cache_admin -mv Observe the buffering status of the memory
phpa_cache_admin -fv Observe the buffering status of the file
phpa_cache_admin -k Set the buffer size
5. Summary
INSTALL provided by this software The document elaborates on some aspects of performance, and I will not go into details here.
It should be noted that FreeLAMP.com’s articles are currently not PHP-based, but the forum system is PHP-based, so the performance improvement will only be an improvement in the forum system.
The above introduces the method of cdn website acceleration php-accelerator website acceleration PHP buffering, including the content of cdn website acceleration. I hope it will be helpful to friends who are interested in PHP tutorials.