When attempting to compile using PECL install, you will likely get an error stating:

checking whether the C compiler works… configure: error: cannot run C compiled programs.

This is due to the environment CentOS and Redhat flavors have for the /tmp directory. Rather than remounting /tmp without exec, you can compile the module manually on the user account. In this example, I’m compiling and installing the APC module. NOTE: ensure you are doing this ON the user’s account and not as root unless you want the module installed server wide.

cd ~
mkdir setups
cd setups
wget http://pecl.php.net/get/APC-3.1.2.tgz
tar -xvf APC-3.1.2.tgz
cd APC-3.1.2
phpize && ./configure –with-apxs && make

This will compile the module successfully, without the need to write or execute compiled programs in /tmp. Now simply add the extension to php.ini and ensure it loads in phpinfo().

You’re done.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

  1. I am new to blogging, so I feel like I am in the “just taking notes” phase. But when I do find a blog topic I like, I do comment because I genuinely like what has been said or the information was helpful to me. I am officially linked to your blog now, so I will be checking in often! Thanks for all the great advice.