首页 > 开发 > PHP > 正文

php-accelerator网站加速PHP缓冲的方法

2024-05-04 22:12:19
字体:
来源:转载
供稿:网友
http://php-accelerator.co.uk/ 可以下载,是zend的强劲对手。是免费的。我已经在用啦。效果还不错。
修改 PHP.ini 加上:
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 就能用啦。具体参数看它的文档。

 
  我们在 “LAMP 加速” 这篇文章中阐述过加速的几种办法,其中提到了 PHP Accelerator,它的安装方法十分简单,但是需要去他的网站获取一个激活键。

  一、下载:
  www.php-accelerator.co.uk/download.php

  二、获取激活键并安装:

  www.php-accelerator.co.uk/activate.php 
  注册自己的 SERVER_NAME 后,你会得到下面的提示:
  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>

  具体的 phpa 值的设置,可以参考软件随带的 CONFIGURATION 文件的配置。

  由于大多数网站是虚拟主机配置,所以,建议采用 php_value phpa. 的方式设置。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表