Install PECL modules without the prompts

BannerMan picture BannerMan · Nov 15, 2011 · Viewed 30.9k times · Source

I just installed PHP on Ubuntu Natty from source.

I'm trying to use PECL to install additional modules like APC and Memcache. I'm using something like this:

pecl install apc

However, I get prompts asking me to confirm things.

How can I use the pecl command to just accept the defaults? I saw something like this on a message board: printf "yes\n" | pecl install pecl_http. However, in the case of APC this would answer yes for things where the default is no (I think).

Thanks in advance.

Answer

BannerMan picture BannerMan · Nov 16, 2011

The following code seems to work ok:

printf "\n" | pecl install apc

You can also replace apc with any other PECL package.

Cheers.