Install PECL modules without the prompts

徘徊边缘 提交于 2020-01-30 13:51:41

问题


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.


回答1:


The following code seems to work ok:

printf "\n" | pecl install apc

You can also replace apc with any other PECL package.

Cheers.




回答2:


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



回答3:


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


来源:https://stackoverflow.com/questions/8141407/install-pecl-modules-without-the-prompts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!