HOWTO: Install PHPAccelerator

loopforever

Verified User
Joined
May 30, 2003
Messages
298
Location
/home/admin
This guide is a slightly updated version of my previous PHPAccelerator HOWTO, which was originally posted on the Rackshack forums, which, was originally written by the owner of unoffical-support.com.

It works on DA systems, and I encourage users to install it to boost system preformance.

Before you start, make sure you are root.

Code:
mkdir /usr/local/phpaccelerator
cd /usr/local/phpaccelerator

wget [url]http://www.php-accelerator.co.uk/releases/linux_i686-glibc2.1.3/1.3.3r2_4.3.0/php_accelerator-1.3.3r2_php-4.3.0_linux_i686-glibc2.1.3.tgz[/url]

tar zfx php_accelerator-1.3.3r2_php-4.3.0_linux_i686-glibc2.1.3.tgz
rm -f php_accelerator-1.3.3r2_php-4.3.0_linux_i686-glibc2.1.3.tgz

mkdir /home/phpacache
chmod 5777 /home/phpacache
Next, check to see if your system has a php.ini file in use:
Code:
less /usr/local/lib/php.ini

If it does NOT exist, copy the original:
Code:
cp -f /usr/local/directadmin/scripts/packages/php-4.3.0/php.ini-recommended /usr/local/lib/php.ini

Now, open /usr/local/lib/php.ini in your favorite editor and scroll down, or search until you get to the Dynamic Extensions section. After the line that reads "; extension_dir directive above." Copy the following:
Code:
zend_extension="/usr/local/phpaccelerator/php_accelerator_1.3.3r2.so"
phpa.cache_dir = /home/phpacache
phpa.shm_ttl = 12h
phpa.shm_max_processes = 512
phpa.shm_stats_check_period = 5m
phpa.shm_size = 32

Finally, save and exit your editor. And restart Apache (/etc/rc.d/init.d/httpd restart).

You can confirm that your PHPA installation was successful, by visiting Rex Swain's HTTP Header viewer, and entering the URL to a PHP file on your server: http://www.rexswain.com/httpview.html.

Enjoy :)!
 
Last edited:
Back
Top