Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation recipe improved #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions README
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
1.Install libbeanstalkclient
$mkdir php-beanstalk
$cd php-beanstalk/
$wget https://github.com/bergundy/libbeanstalkclient/tarball/master --no-check-certificate
$mv master bergundy-libbeanstalkclient-b6ec294.tar.gz
$tar -xzvf bergundy-libbeanstalkclient-b6ec294.tar.gz
$mv bergundy-libbeanstalkclient-b6ec294 libbeanstalkclient
$cd libbeanstalkclient/
$mkdir m4
$sudo ./autogen.sh
$sudo vim /etc/ld.so.conf
/usr/lib
$sudo ldconfig
1.Install libbeanstalkclient

$ mkdir php-beanstalk
$ cd php-beanstalk/
$ wget https://github.com/bergundy/libbeanstalkclient/tarball/master --no-check-certificate -O - | tar -zxvf -
$ cd bergundy-libbeanstalkclient*
$ mkdir m4
$ sudo ./autogen.sh
$ sudo echo "/usr/lib" >> /etc/ld.so.conf
$ sudo ldconfig

2.Install php-beanstalk
$wget https://github.com/nil-zhang/php-beanstalk/tarball/master --no-check-certificate
$mv master php-beanstalk.tar.gz
$tar -xzvf php-beanstalk.tar.gz
$cd php-beanstalk
$phpize
$./configure
$make
$sudo make install
$sudo vim /etc/php.d/beanstalk.ini
extension = "beanstalk.so"
$php -m

$ wget https://github.com/nil-zhang/php-beanstalk/tarball/master --no-check-certificate -O - | tar -zxvf -
$ cd nil-zhang-php-beanstalk*
$ phpize
$ ./configure
$ make
$ sudo make install

## PHP 5.3 on Ubuntu 12.04
$ sudo echo 'extension = "beanstalk.so"' >> /etc/php5/conf.d/beanstalk.ini

## PHP x.x (Unknown)
$ sudo echo 'extension = "beanstalk.so"' >> /etc/php.d/beanstalk.ini

$ php -m

3.Using example

-----example.php----------
<?php

$bsc = new Beanstalk();

$bsc->addserver("ip1", 11300);
$bsc->addserver("ip2", 11300);
$bsc->addserver($hostname = "127.0.0.1", $port = 11300, $weigth = 10);
// $bsc->addserver("ip2", 11300);

$tubes = $bsc->list_tubes();
print_r($tubes);
Expand Down