Integrating APC (Alternative PHP Cache) Into PHP5 (Fedora 8 & Apache2)
Integrating APC (Alternative PHP Cache) Into PHP5 (Fedora 8 & Apache2)Version 1.0 This guide explains how to integrate APC (Alternative PHP Cache) into PHP5 on a Fedora 8 system (with Apache2). APC is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cachers, such as eAccelerator and XCache. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI have tested this on a Fedora 8 server with the IP address 192.168.0.100 where Apache2 and PHP5 are already installed and working. I'll use Apache's default document root /var/www/html in this tutorial for demonstration purposes. Of course, you can use any other vhost as well, but you might have to adjust the path to the info.php file that I'm using in this tutorial.
2 Checking PHP5's Current StateFirst, before we install APC, let's find out about our PHP5 installation. To do this, we create the file info.php in our document root /var/www/html: vi /var/www/html/info.php
Afterwards, we call that file in a browser: http://192.168.0.100/info.php As you see, we have PHP 5.2.4 installed... ... but APC isn't mentioned anywhere on the page:
3 Installing APCAPC is a PHP extension that can be installed using PECL. PECL comes with the php-pear package, so we install that now: yum install php-pear Furthermore we must install some APC dependencies so that PECL can build APC: yum install php-devel httpd-devel yum groupinstall 'Development Tools' yum groupinstall 'Development Libraries' Now that all dependencies are installed, we can install APC as follows: pecl install apc [root@server1 ~]# pecl install apc Now that APC is installed, we create the configuration file /etc/php.d/apc.ini. We must at least add the line extension=apc.so in there; all other configuration options are optional. You can find a list of all available configuration options on http://de2.php.net/manual/en/ref.apc.php. vi /etc/php.d/apc.ini
That's it. Restart Apache, and you're done: /etc/init.d/httpd restart Afterwards, open info.php again in a browser: http://192.168.0.100/info.php You should now see APC mentioned on the page which means it has successfully been integrated and is working as expected:
4 Links
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning










Recent comments
19 hours 27 min ago
23 hours 53 min ago
23 hours 54 min ago
1 day 1 hour ago
1 day 1 hour ago
1 day 8 hours ago
1 day 13 hours ago
1 day 14 hours ago
1 day 14 hours ago
1 day 15 hours ago