简体   繁体   中英

How to install gearman extension in php7 running on ubuntu 18.04

I am currently required to setup the new server running php7.2 and the server will have many background process for sending emails to customer. the recommendation I got was to use Gearman Job Server. I have been searching but seems to have only post about gearman-job-server with php5 and below.

The process of installing Gearman Job Server with php7 will be covered in like 4 steps

Install and update the Gearman PPA sudo apt-get install software-properties-common sudo add-apt-repository ppa:gearman-developers/ppa sudo apt-get update

Install Gearman Job Server and some other required components and tools sudo apt-get install gearman-job-server libgearman-dev php7.0-dev php-pear wget unzip re2c sudo apt-get upgrade

Download, compile the gearman pecl module and add to php.ini cd /tmp/ sudo wget https://github.com/wcgallego/pecl-gearman/archive/master.zip unzip master.zip cd pecl-gearman-master sudo phpize ./configure sudo make sudo make install echo "extension=gearman.so" | sudo tee /etc/php/7.0/mods-available/gearman.ini sudo phpenmod -v ALL -s ALL gearman cd /tmp/ sudo wget https://github.com/wcgallego/pecl-gearman/archive/master.zip unzip master.zip cd pecl-gearman-master sudo phpize ./configure sudo make sudo make install echo "extension=gearman.so" | sudo tee /etc/php/7.0/mods-available/gearman.ini sudo phpenmod -v ALL -s ALL gearman

Restart webserver or PHP FPM sudo service php7.0-fpm restart sudo service apache2 restart

If you are running a different version of PHP make sure you make the appropriate changes to the commands or directories mentioned above. ie “/etc/php/7.0/” to “/etc/php/7.1/” etc.

Thanks to techearl.com for their tutorial which can be found Here

Ruberandinda Patience 的答案是正确的并且可以工作,但是由于 gearman pecl 模块是为 Ubuntu 打包的,因此有一种更简单的方法来实现相同的目标:

apt install gearman-job-server php-gearman

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM