Website Accelerated PHP Buffer Free implementation Method _php Foundation

Source: Internet
Author: User
Wen/Xu Yongju

We know Zend has a free tuning engine for PHP, but freelamp this time with a buffer product called PHP Accelerator.

We described several ways to accelerate in the LAMP acceleration article, which refers to the PHP accelerator, which is simple to install, but needs to get an activation key to his web site.


First, Download:

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

Get activation Key and install:

www.php-accelerator.co.uk/activate.php

After registering your own server_name, you will get the following tips:

Your key for www.freelamp.com is 8edfd13946c96309244fcca309415902

Now, must set the key for www.freelamp.com in your site configuration.

For a 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 out in the php.ini (the default is on)

Php_value PHPA 1

</virtualhost>

A specific PHPA value setting can refer to the configuration of the CONFIGURATION file that accompanies the software.

Since most Web sites are virtual host configurations, it is recommended that php_value PHPA be used. The way set.

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

Third, set up php.ini

Suppose we untie the downloaded file to/usr/local/php, and then add in the 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, browse through an arbitrary PHP page in the browser and see/tmp to generate some files that start with PHPA. Another way to check if buffering works is to look at the output of the phpinfo (), the original Zend tuning engine's description section, has been shown as:

This program makes 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 there are differences between the. So file and the real. So file in installing the INSTALL installation instructions, so you need to notice the difference when you install it.

Four, adjust the buffer size

The PHP accelerator provides a buffer management command:

PHPA_CACHE_ADMIN-MV to observe memory buffering

PHPA_CACHE_ADMIN-FV observation file buffering

Phpa_cache_admin-k Set Buffer size

V. Summary

The software provides a INSTALL file to illustrate some of the performance of the argument, I do not repeat here.

Need to explain, freelamp.com's article is not currently PHP architecture, but the forum system is PHP architecture, so the performance of the promotion will only be the forum system upgrade. (Freelamp: Xu Yongju provides this article)

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.