Install PECL modules without the prompts
The following code seems to work ok:
printf "\n" | pecl install apc
You can also replace apc with any other PECL package.
Cheers.
The "yes" command can do more than just type "yes"; it can type anything you want, over and over. Including an empty line, which is a good way to accept defaults.
I just needed this myself, so here is what worked well for me:
yes '' | pecl install -f apc
Obinwanne's Hill answer nailed it for me, so I'm not providing anything new here, but the following seems like the absolute shortest also without any fancy tools.
echo '' | pecl install apc