sourcecode

Tuesday, July 16, 2013

php gearman

and unpack

2. 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 --ini
then choose a file, e.g.
$sudo vi /etc/php5/cli/php.ini
and add the line  extension=gearman.so

4. verify
$php --info | grep "gearman support"
or
$php -a

php > print gearman_version();
http://edvanbeinum.com/how-to-install-gearman-php-ubuntu


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: