手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆

ubuntu下安装gearman及扩展

首页 > Linux >

Ubuntu下面安装gearman以及php的gearman扩展是需要注意一下的。
不是默认的安装就直接OK
apt-get install gearman
安装完gearman后。使用pecl install gearman安装。这时候会提示你安装新版 的libgearman
如果你直接搜索apt-cache search libgearman,会发现有很多,但其实一个都不是。。不用上当了

OK,怎么办?有人也问过这个问题:http://stackoverflow.com/questions/13312207/installing-gearman-php-extension-on-debian-6
有人这么回复 :

The reason that this doesn't work is that as the error message says, the most recent version of the PHP extension requires libgearman-1.0 (which is why the directory is named 1.0). You'll need to be at least on wheezy (which is the version after debian 6 / squeeze) to get libgearman-1.0.

It might also be a solution to compile libgearman from source, and then use checkinstall to create a debian package that you install afterwards, or use the gearman developer ppa available at https://launchpad.net/~gearman-developers/+archive/ppa. We've built libgearman, gearmand and the PHP extension on a wide variety of distributions (including Debian, Ubuntu, RHEL4 and SL6) and used checkinstall to get a proper package available.

嗯,打开这个网址。
在最上面有提醒你怎么将PPA将入源里:

Adding this PPA to your system

You can update your system with unsupported packages from this untrusted PPA by adding ppa:gearman-developers/ppa to your system's Software Sources. (Read about installing)

OK,那我们开始吧:

 apt-add-repository ppa:gearman-developers/ppa

然后,你根据你的版本,将源加到你的source.list文件里:
vim /etc/apt/source.list
加入:

deb http://ppa.launchpad.net/gearman-developers/ppa/ubuntu precise main  deb-src http://ppa.launchpad.net/gearman-developers/ppa/ubuntu precise main 

然后:apt-get update
apt-get upgrade
会提醒你需要升级gearman到最新版 本
这时候再:
pecl install gearman
然后就直接安装成功,会提示你怎么操作:
XML/HTML代码
  1. Build process completed successfully  
  2. Installing '/usr/lib/php5/20090626+lfs/gearman.so'  
  3. install ok: channel://pecl.php.net/gearman-1.1.1  
  4. configuration option "php_ini" is not set to php.ini location  
  5. You should add "extension=gearman.so" to php.ini  
按照提示操作完后,重启apache。
在命令行下执行:
XML/HTML代码
  1. # php -i |grep gearman  
  2. gearman  
  3. gearman support => enabled  
  4. libgearman version => 0.40  
wow...安装成功。
就是这么简单

 




本站采用创作共享版权协议, 要求署名、非商业和保持一致. 本站欢迎任何非商业应用的转载, 但须注明出自"易栈网-膘叔", 保留原始链接, 此外还必须标注原文标题和链接.

Tags: ubuntu, gearman, php扩展

« 上一篇 | 下一篇 »

只显示10条记录相关文章

如何mount Smb服务共享目录 (浏览: 54747, 评论: 1)
[笔记]Ubuntu下修改网卡和DNS (浏览: 44144, 评论: 0)
SSH Client 会话空闲超时的解决办法 (浏览: 38492, 评论: 1)
笔记:在Ubuntu中设置samba共享可读写文件夹 (浏览: 35138, 评论: 0)
为debian增加apt-add-repository功能 (浏览: 30858, 评论: 3)
RabbitVCS 用后感 (浏览: 30293, 评论: 0)
svn ignore 命令行用法 (浏览: 28901, 评论: 1)
Linux下的MSN:galaxium (浏览: 27024, 评论: 4)
wubi惊魂 (浏览: 25616, 评论: 2)
ubuntu下最简单的更改时区 (浏览: 24824, 评论: 1)

发表评论

评论内容 (必填):