1. Download from
http://pecl.php.net/package/gearman
and unpack2. under the unpacked folder,
$phpize
$./configure
$make
$sudo make install
if $phpize gives you an "not found error", install php5-dev:
$sudo apt-get install php5-dev
3. edit ini file
$php --inithen choose a file, e.g.
$sudo vi /etc/php5/cli/php.iniand add the line extension=gearman.so
4. verify
$php --info | grep "gearman support"or
$php -ahttp://edvanbeinum.com/how-to-install-gearman-php-ubuntu
php > print gearman_version();
5. Test as a gearman client (An Example Client):
http://gearman.org/gearman_php_extension
save the file as hello.php
and in terminal, run
$php hello.php
6. More to read:
http://www.php.net/manual/en/book.gearman.php
http://toys.lerdorf.com/archives/51-Playing-with-Gearman.html
https://www.rssinclude.com/blog/36_how_to_run_php_scripts_in_html_or_htm_files
7. Running on a web browser:
a. create a script to be executed, name it cal.php
and "chmod 500" to it
b. in same folder, created a file to be displayed, name it hello.php
and now open the browser address: http://127.0.0.1/hello.php
it should work, provided there's a gearman worker already up.
No comments:
Post a Comment