Index of /apps/php_accelerator

 NameLast modifiedSizeDescription

[DIR]Parent Directory  -  
[DIR]glibc2/12-Jul-2006 01:49 -  
[DIR]old/12-Jul-2006 01:49 -  
[   ]CONFIGURATION26-Jan-2003 09:03 10K 
[   ]INSTALL26-Jan-2003 09:03 7.8K 
[   ]README.txt26-Jan-2003 09:03 10K 
[   ]phpaca-0.1.0.tgz05-Feb-2002 01:30 21K 
[   ]phpaca-0.1.3.tgz15-Feb-2002 11:08 21K 
[   ]phpaca-0.2.0.tgz24-Apr-2002 02:24 29K 

******************************************************************************

       Configuration Notes for the ionCube PHP Accelerator 1.3.4r1 

******************************************************************************

PHP.INI ENTRIES
---------------

PHPA has recommended defaults for all ini entries except for the path to the
library extension. 

The path to the extension should be specified as:

  zend_extension = /path/to/php_accelerator_1.3.4r1.so

where /path/to is the directory underwhich you installed the accelerator. 
A typical location might be /usr/local/lib

All other entries are optional and the entries shown below can be set
to configure PHPA as necessary. You may wish to familiaise yourself with
them and change the default settings for some once you have PHPA up
and running. 
 
** THINGS TO NOTE

You must stop and restart Apache for them to take effect. 
The values for ini entries can be given with or without double quote
delimiters unless spaces are required in the value. Only double quotes 
can be used to delimit strings. e.g. both

phpa.phpa = on
phpa.phpa = "on"

are valid, whereas

phpa.phpa = 'on'

is *not* valid.

Entries that can be enabled or disabled can be set by using the words on or
off, or 1 or 0. e.g. phpa = on  or  phpa = off

General
-------

; Enable or disable the Accelerator entirely. Defaults to "on".

phpa = on


; Enable or disable the builtin Accelerator code optimiser. Defaults to "on".
; You should always leave this enabled as it reduces code size and speeds 
; things a little

phpa.tweaks = on


; Enable a workaround for a bug in PHP that can cause PHP to incorrectly
; report that a script has run out of memory. Defaults to 0, i.e. disabled.
; Set to "on" or 1 to enable.
; NOTE: This is only relevant is PHP was built with --enable-memory-limit

phpa.enable_php_memory_bug_workaround = 0


File Cache
----------

; Sets the file cache directory. Must be an absolute path. 
; Defaults to /tmp. Avoid using ram based or NFS file systems for the 
; cache directory. Unless the shm cache is disabled, the cache files are
; only used when a new or changed file is cached, or if
; there is no cache entry in shared memory. Some RAM based file systems are
; buggy and can report problems with memory mapped files. If you see errors
; to do with cache files and are using a ram based file system, switch to
; a disc file system.

phpa.cache_dir = /tmp


; Sets the cache file permissions. This is an octal value. Defaults to 400.

phpa.file_perms = 400


; Specifies a list of file patterns to ignore as a comma separated list of
; complete or partial file paths.
; A file is ignored if the end of its path matches an item in the list
; e.g.

phpa.ignore_files = "/index.php,/a/help.php"


; Specifies a list of partial file paths to ignore. Files below any of the
; path components are ignored.
; e.g.

phpa.ignore_dirs = "/data/WWW/site1/,/cache/"


; Specify the period between scans of the file cache looking for files to 
; remove (prune). Pruning is triggered by a page request, and performed after
; the page request has completed. Pruning operates on the cache directory that
; was set for the request, and a request that uses a given cache directory is
; required in order for that directory to be scanned. The period should be a
; number followed by the letter s,m,h or d, for seconds, minutes, hours or
; days.
; The default is 1h, for 1 hour. Setting the time to 0 disables cache pruning.

phpa.cache_file_prune_period = 1h


; Specify the age after which a cache file will be removed at the next scan
; of its cache directory. The age is determined by looking at the access time
; of the file. Files are accessed when they are created and when read. 
; Cache files are read if there is no corresponding shared memory cache entry. 
; The default period is 1d, for 1 day. If the web server is restarted 
; regularly, e.g. every 24 hours, then this value should be set to be longer 
; than the restart interval such that the cache files can be read and used to 
; populate the new shm cache after the server restart, rather than the script 
; files having to be read again.  If a site keeps creating new script files, 
; such that large numbers of cache files are created, then ttl period should 
; be reduced.

phpa.cache_file_ttl = 1d



SHM Cache
---------

; Sets the shared memory cache size in megabytes. 
; Integer values only. Defaults to 8MB. You may want to change this after 
; PHPA has been running for a while. Use 'phpa_cache_admin -mv' to see what
; the memory usage is like, and adjust if necessary based on the maximum
; memory ever used. 2MB more than the maximum used is suggested.

phpa.shm_size = 8


; Sets the shared memory key. Maybe be specified in hex notation as below 
; or as an integer.
; Defaults to 0xc0deb00

phpa.shm_key = 0xc0deb00


; Sets the shared memory permissions. This is an octal value. Defaults to 666.
; The cache generally only needs to be accessed by the owner, and you may
; want to set this to 600 

phpa.shm_perms = 666


; Specify the name or id of the user and group to own the shared memory cache.
; For apache these default to the user and group specified in the apache 
; configuration file, and this is what is required.
; ** These had to be set before release 1.3.2 revision 2, but from revision 2
; onwards they are determined automatically, so should uusually not be set.
; Only set them if there are warnings in the error log about not being
; able to set the user and group id for the shared memory cache. 
; The end result must be that the user and group are the same as the 
; web server.

phpa.shm_user = 
phpa.shm_group = 


; Sets whether the shared memory and semaphores should be released 
; automatically when the web server shutsdown and removed if existing
; before startup. Defaults to on.

phpa.shm_release_at_exit = on


; Sets the interval between checks of the shared memory cache for 
; rebalancing. Note that PHPA will ALWAYS recache a file if it's changed. 
; This is the period between scanning the cache and maybe remove old entries  
; A purely numeric interval is in seconds, otherwise append one of 's', 'm',
; 'h', 'd' to specify a period in seconds, minutes, hours or days.
; e.g 10m is ten minutes, 3h is three hours.
; Defaults to 5 minutes

phpa.shm_stats_check_period = 5m


; Sets the time-to-live period for shared memory cache entries.
; Specify a period as a number followed by 's', 'm', 'h', 'd' to denote
; seconds, minutes, hours, or days. E.g. 12h, 7d etc.
; Any shared memory cache entries that haven't been accessed within this period
; will be flushed from the cache the next time cache stats are checked, (as 
; determined by the setting of phpa.shm_stats_check_period). 
; The period defaults to 12 hours and is probably suitable for most cases. 
; Sites where the cache is undersized or where files often become stale 
; (e.g. because files are replaced with new versions [as opposed 
; to being overwritten] might want to reduce this.  
; Sites where files may not be accessed for longer than 12 hours 
; could increase the value. 

phpa.shm_ttl = 12h


; Specifies a list of file patterns to be excluded from the shared memory 
; cache. The list should be a comma separated list of complete or partial 
; file paths. A file is ignored if the end of its path matches an item in the 
; list. e.g.

phpa.shm_ignore_files = "/index.php,/a/help.php"


; Specifies a list of partial file paths to be excluded from the shared memory
; cache. Files below any of the path components will not be cached in shared
; memory.
; e.g.

phpa.shm_ignore_dirs = "/data/WWW/site1/,/nocache/"


; Sets the maximum number of Apache instances that may use the shared memory
; cache. The default value is 512. Setting to one more than 
; the MaxClients apache parameter is optimal. Any processes created after the
; limit is reached will still benefit from acceleration gained from using the 
; file cache.

phpa.shm_max_processes = 512


; Sets the period in seconds before a process waiting to get a lock on the 
; shm cache will log a warning to say that it's been trying for a while.

phpa.shm_lock_threshold0 = 10


; Sets the period in seconds before a process waiting to get a lock on the 
; shm cache will decide to break the cache lock even if the process holding 
; the lock is still alive. Do not change this unless advised to as it may
; cause PHPA to kill processes that are legitimately using the cache

phpa.shm_lock_threshold1 = 10



PER-REQUEST CONFIGURATION
-------------------------

The following directives can be added to Apache configuration files 
within <Directory> or <Location> blocks to control the Accelerator on a 
per-request basis. <on|off> means either on or off. Do not include the < >
characters

# Enable or disable the code optimiser
php_value phpa.tweaks <on|off>

# Enable or disable the accelerator
php_value phpa <on|off>

# Set the file cache directory
# Overrides the php.ini setting for this request
php_value phpa.cache_dir <path>

# Set the TTL (Time To Live) period for shared memory cached entries
# Overrides the php.ini setting for this request
php_value phpa.shm_ttl <period>

# Set the ignored files
php_value phpa.ignore_files <list>

# Set the ignored directories
php_value phpa.ignore_dirs <list>

# Set the file patterns for files that will not be cached in shared memory
php_value phpa.shm_ignore_files <list>

# Set the directories below which files will not be cached in shared memory
php_value phpa.shm_ignore_dirs <list>

Examples:

# Use /tmp/site1_phpa_cache for cache files of site1
# Set shared memory cache entries to have a 6 hour ttl
#
<Location /site1>
  <IfModule mod_php4.c>
    php_value phpa.cache_dir /tmp/site1_phpa_cache
    php_value phpa.shm_ttl 6h
  </IfModule>
</Location>

# Use /tmp/site2_phpa_cache for cache files of site2
# Set shared memory cache entries to have a 2 day ttl
#
<Location /site2>
  <IfModule mod_php4.c>
    php_value phpa.cache_dir /tmp/site2_phpa_cache
    php_value phpa.shm_ttl 2d
  </IfModule>
</Location>

# Disable phpa for any requests within http://site2/xdir/
#
<Location /site2/xdir>
  <IfModule mod_php4.c>
    php_value phpa off
  </IfModule>
</Location>


STANDALONE COMMAND LINE CONFIGURATION
-------------------------------------

Acceleration of standalone PHP scripts, e.g. using php for cgi-bin scripts,
is no longer supported. Support for standalone scripts may be provided in
a future version.

-- Copyright (c) 2002-2003, ionCube Ltd., 26 January 2003 --