How can I install APC?

Tertsi

Verified User
Joined
Mar 2, 2007
Messages
39
My server has DirectAdmin's latest version, Apache 1.3.37 and CentOS 4.4 installed.

Obviously the normal install instructions for APC won't work because of DirectAdmin's annoying customapache stuff.

But here they are so you could help me and anyone else who would like to install APC:

Code:
$ gunzip -c apc_x.y.tar.gz | tar xf -
$ cd apc_x.y
$ /usr/local/php/bin/phpize
$ ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/php/bin/php-config
$ make
$ make install

And here's how I tried and failed to install APC:
Code:
cd /usr/local/directadmin/customapache
gunzip -c APC-3.0.14.tgz | tar xf -
I added these lines properly to configure.php: --enable-apc --enable-apc-mmap
./build clean
# All fine to this point.
./build php
cd APC-3.0.14.tgz
make
make install

./build php fails because my PHP version is 5.2.1 and it requires php 4.4...tar.gz in the customapache folder it seems. So ok, I modified the build file to say PHP_VER 5.2.1 and I downloaded the php5.2.1.tar.gz to the customapache folder too but now when I try to exec ./build it says unexpected end of file.

So could someone please give me a step by step guide how to install APC in a system that has DirectAdmin?
 
Last edited:
Use:
Code:
/usr/local/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/bin/php-config
make
make install
 
Thanks a lot for the prompt reply! Does that ./configure just add those new config options or does it also remove the other existing ones? (I suppose not).
 
Do:
Code:
make clean

Before these commands (when you enter the APC directory).
 
I don't want to remove the existing configs, I just wanted to make sure it doesn't remove them. So do I still need to execute make clean?
 
"Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script."

So how to fix this problem?
 
All done but it didn't get installed. I ran a phpinfo() test and no APC info was outputted.

So this is what I actually did:

Code:
cd /usr/local/directadmin/customapache/APC-3.0.14
yum -y install autoconf
/usr/local/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/bin/php-config
make clean
make
make install
restarted httpd through DA
 
Yes, you need to add the extension to /usr/local/lib/php.ini and then restart the httpd service.
 
HI,

Installed APC and add the following to the php.ini file:
(below the other disabled win extentions)
extension=apc.so

Save the file and restart httpd, error:
PHP Warning: Unknown(): Unable to load dynamic library './apc.so' - ./apc.so: cannot open shared object file: No such file or directory in Unknown on line 0

What goes wrong?

EDIT: I change the line in php.ini to: extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so
No errors anymore
 
Last edited:
install causes errors

I was able to successfully install on one of our DA boxes, but tried install on another box (8 gig, 2x quad-core xeon) and attempting to load any php file after successful apache restart results in this error

Allowed memory size of 268435456 bytes exhausted (tried to allocate 373428321 bytes) in Unknown on line 0


Uhm... how is it possible to have "in Unknown on line 0" ???

We do have a prepend php file, but whenever that generates errors, it clearly states the prepend file is to blame. Never seen an "unknown line 0" before.

Any ideas anyone?
 
Your PHP memory limit is set below whatever that script is that you're trying to run (i.e. the script is trying to use/using 64MB of memory and your memory_limit is set to 32MB )

This is located in your php.ini file.
 
Your PHP memory limit is set below whatever that script is that you're trying to run (i.e. the script is trying to use/using 64MB of memory and your memory_limit is set to 32MB )

This is located in your php.ini file.

That byte number shows my memory limit at 256mb... i doubt I need more than that.

Obviously some sort of bug that would bring my server to its knees if the limit wasn't there.
 
Back
Top