PDA

View Full Version : HOWTO: Install PHPAccelerator


loopforever
06-23-2003, 07:18 PM
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.


mkdir /usr/local/phpaccelerator
cd /usr/local/phpaccelerator

wget 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

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:

less /usr/local/lib/php.ini


If it does NOT exist, copy the original:

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:

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 :)!

ian
07-02-2003, 03:16 PM
I believe it's php_accelerator_1.3.3r2.so

loopforever
07-06-2003, 07:30 PM
Correct, fixing original post now... :) Thanks!

frecky
10-28-2005, 11:19 PM
What about php 4.4.3?

Will it still work?

pera
05-20-2006, 07:11 PM
I think no