Alternative PHP cache on SUSE 9.3 Professional
Heine Wed, 2007/02/21 - 04:17
Forget about # pecl install apc
(Alternative PHP Cache on Debian Sarge). This is going to hurt.
All steps in this short overview were necessary on a Strato V-PowerServer. Depending on your installation, your mileage may vary.
# yast -i autoconf automake make gcc binutils php4-devel mysql-devel
Some packages were necessary for the pecl install apc attempt and may not be necessary for the 'manual' apc installation.
Download and unpack the APC archive (in /tmp)
[fetched APC-3.0.12p2.tgz]
# tar -zxvf APC-3.0.12p2.tgz
Time to configure and compile
# phpize
# export CPPFLAGS="-I/usr/include/apache2 -DAPC_PHP4_STAT"
# ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/bin/php-config --with-apxs=/usr/sbin/apxs2
# make
# make install
[apc.so will be placed in the extensions directory]
Open /etc/php.ini and add
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
Restart Apache
Check whether all is well by placing info.php in your webroot (and visiting it).
You should see a new block apc with "APC Support - enabled"
You can get some statistics on APC, by moving the file apc.php to a web-accessible directory. Before you can use it, you need to open the file and set the following constants:
defaults('ADMIN_USERNAME', 'your_username'); // Admin Username
defaults('ADMIN_PASSWORD', 'your_password'); // Admin Password - CHANGE THIS TO ENABLE!!!
Comments
Thanks
Submitted by Ivan (not verified) on Wed, 2007/11/28 - 00:13Works great also on suse 9.2!