Installing APC for Concrete5

Permalink
Hi there,

Hoping someone can help out a newbie here... I've read some of the other forum posts about installing APC for PHP to improve the performance of C5, so I'd like to do the same thing.

I successfully installed C5 using Ubuntu Server 8 + LAMP install. But now I'm trying to add APC for PHP and not having any luck. Here are the steps I tried, and where it blew up. I tried following the steps used in other posts but no luck yet.
1) Download the required packages
aptitude install php-pear
aptitude install php5-dev
aptitude install apache2-dev
2) Install and configure APC
pecl install apc
That command fails. I get the following:
54 source files, building
running phpize
Cannot find config.m4
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
ERROR: 'phpize' failed

I do have a config.m4 file in the /usr/local/src/APC-3.0.19 directory, which is where I'm trying to run pecl install apc
Now, if I manually run /usr/bin/phpize, I get a little bit farther:
/usr/local/src/APC-3.0.19# /usr/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519

At that point I continued on with the remaining steps, no errors:
3) echo "extension=apc.so" > /etc/php5/apache2/conf.d/apc.ini
4) edit /var/www/config/site.php to add
define('CACHE_LIBRARY', 'apc');
?>
5) /etc/init.d/apache2 restart

When I restart Apache or the server, the main page crash & burns with a number of messages pointing to a failed/incorrect install of APC. I had to remove the entry in site.php and restart to get the webpage back up.

I suspect I'm trying to run pecl install apc in the wrong path, but I'm not having luck running it elsewhere.

Ideas? Thanks in advance!
Sir_Timbit

 
sirtimbit replied on at Permalink Reply
The frustrating part of this was I tried a new installation of Concrete 5, but this time running off of Ubuntu Server 10, not 8, and installing APC really was all of one line:
sudo apt-get install php-apc
sirtimbit replied on at Permalink Best Answer Reply
After lots more hunting and testing, finally got APC installed with Ubuntu 8. Here's what I did. Hope this helps someone in the future. What a pain compared to Ubuntu 10!
I'm sure the code below will be painfully obvious to most but again I'm a newbie here. :-)

sudo apt-get install php-pear php5-dev apache2-threaded-dev build-essential

(if the above fails with being unable to download some of the required pacakges, you may need to run the following and try again:)
sudo apt-get update --fix-missing


Again, I couldn't get
sudo pecl install apc
to work for me, and it sounds like others have had similar problems. So I did the following instead:
cd /usr/local/src
wget http://pecl.php.net/get/APC-3.1.9.tgz
tar -xzvf APC-3.1.9.tgz
cd APC-3.1.9
phpize
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config
make
make test
make install
cd /etc/php5/cli
nano php.ini

Add the following line to the end of php.ini:
apc.so

Save, then:
echo "extension=apc.so" > /etc/php5/apache2/conf.d/apc.ini
/etc/init.d/apache2 restart
nano /var/www/config/site.php
and add the following line at the end of the file:
define('CACHE_LIBRARY', 'apc');


Save, then restart Apache or reboot. Then go tohttp://server/testingphp.php and look for a section on APC that says 'enabled'. (Assumes you have a file /var/www/testingphp.php with the following:)
<?php phpinfo(); ?>

And hopefully you'll see a speed boost in Concrete5.
nteaviation replied on at Permalink Reply 1 Attachment
nteaviation
The neat file called apc.php comes with your APC install. Move that file into your webspace and then hit it with your browser. Cool APC GUI. See attachment :)
steda replied on at Permalink Reply
steda
Hi all,

nice to read I´m not alone with apc troubles... :)

I found a link on installing apc on ubuntu 8.04 here:

http://www.phpmonkeys.de/2010/01/19/apc-unter-ubuntu-installieren/...

but it is in german. But as bash speaks a universal language, it may help you ;)

I´ve posted a thread few days ago about apc and multiple sites. For exactly ONE c5-Site apc rocks! Problems come when you have multiple c5 sites on one virtual server, if they use one C5-core or not.

Do you have a hint on this?

Regards,
Stefan
programmieraffe replied on at Permalink Reply
programmieraffe
Heres a how-to for using only one c5 core:

http://www.concrete5.org/documentation/how-tos/developers/plesk-mul...

What problems did you get? Full APC cache?