APC Introduction:
The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. (from php.net)
Installation :
- Install from YUM ( Rhel /centos)
- intsall from APT-GET (debina /ubuntu)
- Install from source
- A few tips
- Configure APC in php.ini
1 . Install from YUM
run this commands in ssh:
yum install gcc httpd-devel php-pear
pecl install apc
if you have nay problem please install pcre-devel and try new installation
After installation add
in your php.ini -(see end of post for configuration options)
2.intsall from APT-GET (debina /ubuntu)
sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart
After installation add
in your php.ini -(see end of post for configuration options)
3.Install from source
run this commands
cd /usr/local/src
wget
http://pecl.php.net/get/APC
tar -zxvf APC-3.1.9.tgz
cd APC-3.1.9
phpize
./configure –enable-apc –enable-apc-mmap –with-apxs
make
make install
make install output
[root@testserver APC-3.1.9]# make install
Installing shared extensions: /usr/lib64/php/modules/
Installing header files: /usr/include/php/
see the extension folder : /usr/lib64/php/modules/
add this line to php.ini
extension= /usr/lib64/php/modules/apc.so
restart apache
4.A few tips
- use php -i | grep php.ini for find your php.ini file
- if your using DSO mode – apache not working , you must change to SUphp or fastcgi
- I tried APC in Apache, LightSpeed and nginx
- move apc.php ( include in zip package to your www and see apc digram)
- use must add add extension = apc.so after extension_dir in php.ini
5. Configure APC in php.ini
in php.in find Find extension=apc.so and blow
see your apc. php :
علاقه مندی ها (بوک مارک ها)