Free PHP buffer implementation method-Linux Enterprise Application-Linux server application information. The following is a detailed description. We know that Zend has a free Optimization engine for PHP, but FreeLAMP uses a buffer product called PHP Accelerator this time.
We have explained several methods of acceleration in the article "LAMP acceleration", which mentions PHP Accelerator. Its installation method is very simple, but it needs to get an activation key from its website.
1. Download: Http://www.php-accelerator.co.uk/download.php
2. obtain and install the activation key: Http://www.php-accelerator.co.uk/activate.php
After registering your SERVER_NAME, you will receive 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 details about how to set the phpa value, refer to the CONFIGURATION file with the software.
Because most websites are configured as virtual hosts, we recommend that you use php_value phpa.
For example:
3. Set php. ini Suppose we unbind the downloaded file to/usr/local/php, then add the following to php. ini:
Zend_extension =/usr/local/php/php_accelerator_1.2p2.so
Comment out the original Zend Optimization engine:
# Zend_extension =/usr/local/Zend/lib/ZendOptimizer. so
Restart Apache and browse any PHP page in the browser. Some files starting with phpa are generated under/tmp. Another way to check whether the buffer works is to check the output of phpinfo (). The description of the original Zend Optimization engine has been shown:
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 installation and installation instructions, the. so file and the real. so file are different, so you need to pay attention to this difference during installation.
4. Adjust the buffer size PHP Accelerator provides the buffer management command:
Phpa_cache_admin-mv: Observe the buffer in the memory
Phpa_cache_admin-fv: File Buffer
Set the buffer size in phpa_cache_admin-k.
V. Summary The INSTALL file provided by the software Describes some performance statements. I will not repeat them here.
It should be noted that FreeLAMP.com's article is not currently based on the PHP architecture, but the forum system is based on the PHP architecture. Therefore, the performance improvement will only be the improvement of the forum system.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.