آموزش نصب و کانفیگ کش apc - APC Introduction And Installation ubuntu centos cpanel litespeed nginx
به نام یزدان
اگر با کش های op code آشنا باشید
متوجه میشید که با نصب کش علاوه بر سریع تر لود شدن صفحات
مقدار بسیار زیادی در میزان لود سرور هم تاثیر دارن
و برای سیستم های مدیریت محتوایی نظیر جوملا و ورد پرس به میزان بسیار زیادی در لود سایت تاثیر داره
http://hostwp.com/apc-introduction-a...tespeed-nginx/
1. نصب از طریق yum
کد PHP:
yum install gcc httpd-devel php-pear
pecl install apc
کامندها رو اجرا کنید
ممکن هست با اررو مواجه شید که ارورش دقیقا توی خاطرم نیست
ولی با نصب این پکیج حل میشه
کد PHP:
yum install pcre-devel
در روند نصب سوال هایی که پرسیده میشه کلا enter بزنید بره
اگر نصب موفقیت امیز بود
این خط رو در php.ini لود کنید
و بعد اقدام به گرفتن اینفو از php کنید تا مطئن بشیم apc لود شده
اگر نصب موفقیت امیز بود ولی فایل لود نشد باید اقدام به تنظیم فولدر اکستنشن های php کرد
تا اینجا apc نصب میشه
فردا ادامه نصب در سایر سیستم عامل ها و کانفیگ رو میزارم
ایت عکس هم از apc گذاشتم که مربوط به سایتی هست که یه سرور با رم 16 هتزنر رو به طور کامل تصاحب کرده بود
و سی پی یو کم می اورد
و الان با یه وی پی اس بار رم 2 داره با سرعتی 3 برابر قبل لود میشه
تعداد ریکوئست ها در ثانیه رو ببینید
بر روی تصویر کلیک نید
http://www.picofa.org/images/zci8c2y...9md8_thumb.png
APC Introduction And Installation ubuntu centos cpanel litespeed nginx
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