23Systems Web Devsign

Custom website design and development

  • Home
  • Blog
  • Forums
  • Themes
  • Plugins
  • Downloads
  • Portfolio
  • Contact
  • Donate

Installing Alterative PHP Cache (APC) with Plesk on Ubuntu

You are here: Home » Blog » Linux » Apache » Installing Alterative PHP Cache (APC) with Plesk on Ubuntu
 
Parallels Plesk

Parallels Plesk

Ubuntu Linux

Ubuntu Linux

Alternative PHP Cache (APC) is a PHP accelerator. PHP accelerators are extensions built to increase the performance and decrease the load time of software applications written using the PHP programming language. Most PHP accelerators work by caching the compiled bytecode of PHP scripts to avoid the overhead of parsing and compiling source code on each request. A PHP accelerator typically reduces server load and increases the speed of PHP code anywhere from 2-10 times.

APC is a free, open source accelerator that optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory.

This should improve performance on both physical and virtual hosted machines. These instructions are aimed at Plesk users but should be easily adapted to any Debian based installation.

To install APC the first course of action you will need to take is enter the following command on your server:

sudo apt-get install php-pear php5-dev gcc apache2-threaded-dev

Once that has completed you should be able to run the following:

pecl install apc

You should see something like this:

downloading APC-3.0.19.tgz ...
Starting to download APC-3.0.19.tgz (115,735 bytes)
.........................done: 115,735 bytes
47 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
1. Use apxs to set compile flags (if using APC with Apache)? : yes
 
1-1, 'all', 'abort', or Enter to continue:

Hit Enter

Next you will need to enable the extension, use vi or nano or whatever your favorite text editor for Linux is.

sudo vi /etc/php5/conf.d/apc.ini

At the very minimum you will need to add the follow to the file:

extension=apc.so
apc.enabled=1
apc.shm_size=30

There are numerous options for APC so please see the following http://us3.php.net/manual/en/apc.configuration.php for details

Copy the apc.php file to your website:

sudo cp /usr/share/php/apc.php /var/www/vhosts/domain.tld/httpdocs

Edit the apc.php file and change the default username and password. These must be changed inorder to login to the APC control panel.

sudo vi /var/www/vhosts/domain.tld/httpdocs/apc.php
defaults('ADMIN_USERNAME','apc'); 			// Admin Username
defaults('ADMIN_PASSWORD','password');  	// Admin Password - CHANGE THIS TO ENABLE!!!

After that issue the following command

sudo /etc/init.d/apache2 restart

You should be good to go and APC should be running. To verify got to yourdomain.tld/apc.php.

  • Delicious
  • Digg
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Technorati Favorites
  • Twitter
  • Share/Bookmark

Tags: alternative php cache, Apache, apc, Linux, plesk, ubuntu

This entry was posted on Friday, July 24th, 2009 at 4:02 pm and is filed under Apache, Linux, Wordpress, development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« WordPress/Twitter/Facebook Integration
Lightbox Plus 1.5.5 »

Leave a Reply

Click here to cancel reply.

 
  • Pages

    • Home
    • Blog
    • Forums
    • Themes
    • Plugins
    • Downloads
    • Portfolio
    • Contact
    • Donate
  • Tags

    23Systems actionable ajax automatic blog blogs cakephp change log colorbox design development facebook facelift facelift image replacement firefox flir framework gallery IE 6 image image overlay images javascript JQuery lightbox Lightbox Plus MediaWiki menus opera photo php picture Plugins programming resources safari symfony templates Themes twitter Web 2.0 web browsers Web design web development Wordpress
  • Categories

    • 23Systems
    • Apache
    • design
    • development
    • Lightbox Plus
    • Linux
    • MediaWiki
    • php
    • Plugins
    • Themes
    • Wordpress


 
  • Meta

    • Register
    • Lost your password?
    • Entries RSS
  • Become a Fan/Follow Us

    Follow us on Twitter Fan us on Facebook
  • 23Systems Network

    • MetaMythos
    • Technologue
    • The Hollow Men
    • The World According to Nouns
  • MediaWiki

    • Developer Hub
    • Documentation
    • Extensions
    • Skins
    • SysAdmin Hub
    • User Hub
  • Related Links

    • Facelift Forums
    • Facelift Image Replacement
    • Lightbox JS
  • Wordpress

    • Development Blog
    • Documentation
    • Plugins
    • Suggest Ideas
    • Support Forum
    • Themes
    • WordPress Planet
Entries (RSS) and Comments (RSS).
© 2009 23Systems.