README 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. The Gearman PHP Extension provides a wrapper to libgearman. This
  2. gives the user the ability to write fully featured Gearman clients
  3. and workers in PHP, allowing them to quickly develop distributed
  4. applications.
  5. For more information about Gearman, see: http://www.gearman.org/
  6. Requirements
  7. * For the 0.8.* versions, libgearman v0.14 or greater
  8. * For the 1.0.* versions, libgearman v0.21 or greater
  9. * For the 1.1.* versions, libgearman v1.1.0 or greater
  10. * For the 2.0.* versions, testing is done against libgearman v1.1.8 and PHP 7.0-7.4
  11. * For the 2.1.* versions, testing is done against libgearman v1.1.18 and PHP 7.0-8.3
  12. The Gearman PHP Extension requires the Gearman C server and library package
  13. to be installed. You can download the latest from:
  14. https://github.com/gearman/gearmand/releases
  15. See the README file in that package for installation instructions. Once
  16. it is installed you can compile the Gearman PHP Extension. You'll need
  17. to make sure you have the PHP development packages installed first
  18. (if you have 'phpize' command you’re all set). You'll also probably
  19. want the PHP command line interface installed as well (usually named
  20. php-cli). After extracting the Gearman PHP tarball, just run:
  21. phpize
  22. ./configure
  23. make
  24. make install
  25. You then need to make PHP aware of the new extension by adding the
  26. following line to your php.ini:
  27. extension="gearman.so"
  28. You can then test if the module is configured correctly with the
  29. PHP cli:
  30. php --info | grep gearman
  31. To run a simple example
  32. cd examples
  33. 1. Start the gearmand server in a separate terminal:
  34. gearmand
  35. 2. In another terminal, change to this source directory and run:
  36. php examples/reverse_worker.php
  37. 3. In another terminal, change to this source directory and run:
  38. php examples/reverse_client.php
  39. You should see some output from both the reverse client and worker
  40. scripts about the status and then a final result.
  41. Have fun!
  42. http://pecl.php.net/package/gearman