I am trying to install memcache on my VPS. When I type

$ pecl install memcache

I get this error

checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/memcache/configure --enable-memcache-session=yes' failed

Any ideas what the issue could be?


My guess would be check what config.log says. Perhaps you don't have a compiler installed.

  • I am certain I have a compiler installed. I cannot seem to locate the config.log file or I would post that as well. A google search turned up nothing as to where it would be located. Thanks. – smith Oct 16 '09 at 20:51
  • I suspect it would be in /root/tmp/pear/memcache/config.log. – David Pashley Oct 16 '09 at 22:22

I had such an issue on iPhone, where compiled programs should be signed before they can be run. Make a small test: create a simple helloworld program test.c: #include main() { int number=42; printf("The answer is %i\n", number);

And try to compile it: gcc test.c -o test && ./test

This should fail on your system (that's exactly what "cannot run C compiled programs" stands for!). Consult the on-screen errors and examine what's the reason for this.


  • signed? This is Linux, not iPhone. Or I have misunderstood what you've said. – Nilesh Jul 10 '11 at 5:49

sudo pecl install memcache


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy