| 论坛登陆 注册 | 教程 笑话 影视 投稿 |
![]() |
|
||||||||||||||||||||||||||||||||||||||||
网站加速PHP缓冲的免费实现方法 |
|
| www.xker.com 作者: 来源:enet 加入日期:2006-3-28 10:46:20 | |
我们在 “LAMP 加速” 这篇文章中阐述过加速的几种办法,其中提到了 PHP Accelerator,它的安装方法十分简单,但是需要去他的网站获取一个激活键。 一、下载: www.php-accelerator.co.uk/download.php 二、获取激活键并安装: www.php-accelerator.co.uk/activate.php 注册自己的 SERVER_NAME 后,你会得到下面的提示: Your key for http://www.freelamp.com/ is 8edfd13946c96309244fcca309415902 Now you must set the key for http://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 http://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. # http://www.freelamp.com/ VHost entry # < VirtualHost 10.20.30.40> ServerName http://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> 具体的 phpa 值的设置,可以参考软件随带的 CONFIGURATION 文件的配置。 由于大多数网站是虚拟主机配置,所以,建议采用 php_value phpa. 的方式设置。 例如: 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 三、设置 php.ini 假设我们把下载后的文件解开到 /usr/local/php ,那么在 php.ini 中加入: zend_extension=/usr/local/php/php_accelerator_1.2p2.so 并注释掉原来的 Zend 优化引擎: # zend_extension=/usr/local/Zend/lib/ZendOptimizer.so 重新启动 Apache ,用浏览器浏览一个任意 PHP 页面可以看到 /tmp 下面生成了一些 phpa 开头的文件。另外一个检查缓冲是否起作用的办法是看 phpinfo() 的输出,原来的 Zend 优化引擎的说明部分,已经被显示成: 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 需要说明的是,安装 INSTALL 安装说明上的办法,其中的 .so 文件和真实的 .so 文件有差异,所以,你在安装的时候需要注意到这个区别。 本新闻共2页,当前在第1页 1 2 编辑:xker.com上一篇:建立灵巧结构的PHP程序一例 下一篇:没有了 |
||
| 【关闭窗口】【技术交流】【收藏此页】 |
|
| 评论 | |
设为首页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接 |
|
| Copyright © 2003-2006 xker.com All rights reserved.小新技术网 合作广告QQ:12231446 | |
|
|
| 本页浏览次数: |