Dreamhost 安裝APC

#!/bin/sh
#------------------------------------------------------------------------
#
#  APC Install Script for PHP 5.3 Domains
# by Gary Saunders (http://www.bookerthedog.com)
#
#------------------------------------------------------------------------

# Exit if there's an error
set -e

# Clear the screen
clear

echo Setting up...
# Modify as required, defaults work for 99% of things.
LOGILE=apcinstall.log
PHPDIR=$HOME/.php/5.3
APCVERSION=3.1.9
APCURL=http://pecl.php.net/get/APC-$APCVERSION.tgz
APCDIR=$HOME/APC-$APCVERSION

echo Downloading and extracting APC-$APCVERSION.tgz...
# Change into user home directory, download and extract the APC files
cd $HOME
wget $APCURL
tar -xvf APC-$APCVERSION.tgz
cd $APCDIR

echo PHPIZE and building APC...
# Prepare and install the modules
phpize
./configure --with-php-config=/usr/local/php53/bin/php-config; make
mkdir -p $PHPDIR
cp modules/apc.so $PHPDIR
echo extension=$PHPDIR/apc.so >> $PHPDIR/phprc

echo Done, cleaning up the stuff we downloaded...
# Delete the downloaded APC files, don't need them anymore
rm $HOME/APC-$APCVERSION.tgz
rm $HOME/package.xml
rm -rf $APCDIR

echo Killing any existing PHP5 stuff just incase.
# Kill the PHP stuff, just in case it's running
killall php5.cgi 1> /dev/null
killall php53.cgi 1> /dev/null

exit 0

執行完後會在
/user/username/.php/5.3/裡產生apc.so
接著再編輯phprpc

extension=/home/username/.php/5.3/apc.so
[apc]
apc.enabled=1
apc.shm_segments=1
apc.shm_size=16
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/home/username/tmp/apc.XXXXXX
apc.enable_cli=1

接著再執行

killall -9 php53.cgi

然後稍等約2~3分鐘後,就支援APC了!

Popularity: 1% [?]

Share

0 Responses to “Dreamhost 安裝APC”


  • No Comments

Leave a Reply




Switch to our mobile site