Centos – How to install APC and Memcache on CentOS WITHOUT installing the PHP package

centosmemcachePHP

I need to install some extra modules like:

sudo pecl install apc
sudo pecl install memcache

But the pecl program is not installed. Supposedly, I can install it by installing the php-devel package with yum, but yum insists on installing the PHP package too. I've already compiled and installed my own version of PHP from source and don't want/need the packaged version.

How do I get APC and memcache on here?

Configuration options:

./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring
--disable-pdo --with-mysqli with-gd --with-json --with-tidy --with-curl --disable-debug
--with-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-xml --with-zlib
--enable-sockets --enable-sysvsem --enable-sysvshm --enable-soap --enable-pcntl
--enable-bregex --with-mhash --enable-xslt --enable-zip --with-pcre-regex --with-pspell

UPDATE:

OK, found the command, but now when I run it I'm getting:

/usr/local/bin/pecl install apc
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 /var/tmp/pear-build-root/APC-3.0.19/n follows
/tmp/pear/temp/APC/configure: line 3431: /var/tmp/pear-build-root/APC-3.0.19/n: No such file or directory
configure: error: Aborting
ERROR: `/tmp/pear/temp/APC/configure --with-apxs=n' failed

Perl is installed. I'm not planning to use Apache since I want to try Engine-X (I choose no to the Apache question). And what is apxs??

Best Answer

Your custom-compiled PHP should have installed pecl, and configured it properly.

Have you tried running "pecl install apc"?

If your system is not finding pecl, it's probable that you used some funny --prefix when you ./configure'd PHP.

For instance, if you compiled php like this:

$ ./configure --prefix=/foo
$ make
# make install

then you'll either want to get /foo/bin into $PATH, or you could just run

$ /foo/bin/pecl install apc

EDIT: Now I remember: try pecl install apc-beta. Something is screwy with 5.3.3 and non-beta APC. My experience is apc-beta works fine.