Spiga

centos apc install error : apxs: command not found

by Gabi Solomon

I have been trying to install apc for the past 3 hours on my centos VPS and i was getting these error:

Sorry, I was not able to successfully run APXS. Possible reasons:

1. Perl is not installed;
2. Apache was not compiled with DSO support (–enable-module=so);
3. ‘apxs’ is not in your path. Try to use –with-apxs=/path/to/apxs
The output of apxs follows
/root/tmp/pear/APC/configure: line 3263: apxs: command not found
configure: error: Aborting
ERROR: `/root/tmp/pear/APC/configure –with-apxs’ failed

after a alot of searching i finally found the solution. I had to do a manual install.
Asuming you are logged in as root you need to follow the following steps.

1. Grab APC 3.0.8
wget http://pecl.php.net/get/APC-3.0.8.tgz

2.Extract files
gunzip -c APC-3.0.8.tgz

3. change to directory:
cd APC-3.0.8

4. Actual install
phpize
./configure –enable-apc –enable-apc-mmap –with-apxs=/usr/local/apache/bin/apxs –with-php-config=/usr/bin/php-config
make
make install

take note that –with-apxs also specifies the location
As for the rest as the config i am sure you already have opened a ton of pages telling how to do it, if you encountered this error.

Hope you find this page faster then i did.
Cheers

Related Posts

  • Naveen

    Thank you, Thank you, Thank you!
    Exactly what I needed. I got here since 'pecl install apc' wouldnt automatically do it (not because it didnt find apxs) but because in my CentOS VPS, /tmp was mounted with the option of noexec and pecl install would fail since one of the shell scripts in the temporary build directory on /tmp would fail to execute. I thought pecl would let me change the intermediate temp directory, but it wouldnt. So I was looking around to find ways to manually install APC and your page was a lifesaver. Thanks again.