Free implementation of PHP buffer for website acceleration

Source: Internet
Author: User
We know that Zend has a free optimization engine for PHP, but FreeLAMP uses a buffer product called PHPAccelerator this time. We have explained several methods of acceleration in the LAMP acceleration article, which mentioned PHPAccelerator. its installation method is very simple, but it needs to get an activation key from its website. 1. 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.

Language = "JavaScript1.1" src = "http://img.bitscn.com/upimg/allimg/070123/1836470.jpg"/>

1. download:

Www. php-accelerator.co.uk/download. php

2. obtain and install the activation key:

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

#

<VirtualHost 10.20.30.40>

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

</VirtualHost>

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:

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 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©1998-2001 Zend Technologies

With the PHP Accelerator v1.2p2, Copyright©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.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.