How to install gearman extension in php7 running on ubuntu 18.04 - php-7

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
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

The answer by Ruberandinda Patience is correct and will work but since the gearman pecl module is packaged for Ubuntu there is a much simpler way to achieve the same thing:
apt install gearman-job-server php-gearman

Related

Difficulties in installing Qlik Catalog related SW

I am installing Qlik Catalog SW on Linux Read Hat Enterprise 7.9 following the instructions of the installation guide.
I have got the first problem in Tomcat Installation. Basically, I am not able to connect to Tomcat with the browser.
Below is a detailed list of commands I have used.
I have tried it using Firefox.
When trying to install Chrome I got other issues.
Any hints?
*** Installing Chrome ***
# sudo yum install glib
# sudo yum list glibc
# sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
# sudo yum -y install redhat-lsb libXScrnSaver
# sudo yum -y localinstall google-chrome-stable_current_x86_64.rpm
>>>>>>>>>>>>>>>>>>>>>>>
Error: Package: google-chrome-stable-95.0.4638.54-1.x86_64 (/google-chrome-stable_current_x86_64)
Requires: libc.so.6(GLIBC_2.18)(64bit)
<<<<<<<<<<<<<<<<<<<<<<<
*** Installing Tomcat ***
Install wget (if not already installed):
# sudo yum install -y wget
Become the service account user:
# sudo su - qdcuser
Download Apache Tomcat and extract the file in usr/local/qdc:
$ cd /usr/local/qdc
$ wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.38/bin/apache-tomcat-9.0.38.tar.gz
$ tar -xvf apache-tomcat-9.0.38.tar.gz
Overwrite <tomcat home>/conf/server.xml with the version expanded from the Qlik Catalog zip file:
$ cp /tmp/podium/config/tomcat9-server.xml /usr/local/qdc/apache-tomcat-9.0.38/conf/server.xml
Opening ports 8080 and 8443:
# sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
# sudo firewall-cmd --zone=public --permanent --add-port=8443/tcp
# sudo systemctl restart firewalld.service
Setup Apache Tomcat as a service to automatically start when Linux restarts:
# sudo cp /tmp/podium/config/tomcat.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable tomcat.service
Edit the file /etc/systemd/system/tomcat.service to insert the correct user and group names:
# sudo nano /etc/systemd/system/tomcat.service
User=qdcuser
Group=qdcgroup
Start Tomcat manually:
$ cd /usr/local/qdc/apache-tomcat-9.0.38
$ ./bin/startup.sh
Browse to the following URL to verify that Tomcat is running:
https://localhost:8443
>>>>>>>>>>>>>>>>>>>>
Unable to connect
Firefox can’t establish a connection to the server at localhost:8443.
<<<<<<<<<<<<<<<<<<<<<
I too see this issue.. Here is what I think the reason might be..
rpm -qf /usr/lib64/libc.so.6
glibc-2.17-325.el7_9.x86_64
glibc is 2.17 on RHEL 7.9 The developers at google should know this which means it is a bug.
Or. They should provide that library as part of their package and statically link it.
Short answer. For now, until Google figures it out and fixes, I might either remove the package, or skip that package.
To skip..
sudo yum -y update --exclude google-chrome-stable*
To remove... Well.. "sudo yum -y remove google-chrome-stable"
An alternative until google resolve the problem is:
sudo yum update --skip-broken
This can install all updates and ignore chrome

sudo: pecl7.2-sp: command not found

I need to install GeoIP on PHP 7.2 .
For this I am using following commands -
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libgeoip-dev
sudo pecl7.2-sp install geoip-beta
Top two commands are run successfully, But while running the third on I am getting following error -
sudo: pecl7.2-sp: command not found
Any suggestion, How can I install pecl on php 7.2 or any other way to install GeoIP on php 7.2.
I am on ubuntu 16:04 and the following got it working for me (more or less):
Run the following command:
sudo apt-get install php-pear php-dev
Now you can run the command pecl instead pecl7.2-sp - seems to work fine though:
sudo pecl install geoip-beta
Hope that helps.
I had to install imagick for php7.3 so I was getting same error using command like this
sudo pecl7.2-sp install imagick
What worked for me is running the command like this
pecl -d php_suffix=7.3 install -f imagick

Installing Apache OpenWhisk using docker-compose on Amazon Linux instance gets stuck at "waiting for the Whisk invoker to come up..."

I am trying to install openwhisk for dev mode using docker compose on Amazon Linux EC2 Instance. I am following this link for doing so https://github.com/apache/incubator-openwhisk -> Get Started.
Although, it has worked for me before once, in this installation, I am facing an issue. These are the steps I followed:
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo chkconfig docker on
sudo yum install -y python-pip
sudo pip install docker-compose
This step is because open whisk is using sudo for docker-compose, and based on previous steps, sudo docker-compose -v gives a command not found.
sudo cp /usr/local/bin/docker-compose /bin
sudo yum install -y git
cd ~
git clone https://github.com/apache/incubator-openwhisk-devtools.git
cd incubator-openwhisk-devtools/docker-compose
sudo make quick-start
Update: The problem is that the make command gets stuck at the stage where it is waiting for invokers.
I have not made any changes to any source code, nor I did any other steps before this on the instance. It was a freshly created instance.
Am I missing something in OpenWhisk or EC2 or the combination of both? Any help would be great.
Update: I tried the docker-compose method for installing open whisk on Amazon Linux 1, Amazon Linux 2, Ubuntu 16.04 as well as Ubuntu 14.04. On all platforms, it got stuck at sudo make quick-start where it is waiting for invokers.
Update: Instead of using python-pip for docker-compose installation, used the command from docker website as well.
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
if docker-compose command is not found it means you didn't install docker-compose correctly.
I don't think you can install docker-compose as a python library using pip
See the instructions here https://docs.docker.com/compose/install/#install-compose
someting like
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
Or take a look at https://medium.com/#khandelwal12nidhi/docker-setup-on-aws-ec2-instance-c670ff3d5f1b

How to run Rebol on Freya

Been trying to run rebol-view-278-4-2 on Elementary OS "Freya" (a variant of Ubuntu 14.04 LTS).
I keep getting this error:
error while loading shared libraries: libXaw.so.7: cannot open shared object file: No such file or directory
I went ahead and tried to install the missing library but to no avail.
These are the steps I took to get R2 core and view working on Ubuntu 14.04 LTS "Trusty," so I would imagine that this would also work on Freya:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt-get update
sudo apt-get install libx11-6:i386
sudo apt-get install libxext6:i386
sudo apt-get install libxaw7:i386
sudo apt-get install libfreetype6:i386
sudo apt-get install xfonts-100dpi xfonts-75dpi
(I prefer to keep the package install steps separate in case one of them fails.)

phpredis extension doesn't work, unable to load 'redis.so'

I installed nginx, php, php-fpm, php-pecl-redis by yum.
All of them work but the last one.
When I run /usr/sbin/php-fpm, I got this:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/redis.so' - /usr/lib/php/modules/redis.so: undefined symbol: igbinary_unserialize in Unknown on line 0
I don't know what igbnary_unserialize means and how to fix it.
I checked the redis.so file under right path. I add extension=redis.so to php.ini
PHP version: 5.3.3
PhpRedis version: 2.2.7
I had the same issue. I'm on Ubuntu 16.04 LTS. Running sudo apt-get install php-igbinary resolved the issue for me. I have other issues, but that's what solved this one.
For people who are upgrading their php from 7.0 to 7.4 like me, and not able to get php-redis working. These are the steps I used after following the answers above.
1) remove Redis
sudo apt purge php-redis
2) Install Igbinary
sudo apt-get install php-igbinary
3) Install php-redis again
sudo apt-get install php-redis
I did the steps above because it seems only php7.0 is recognising the php-redis install but not the currently enabled php7.4
I also recommend removing other versions of PHP if you have should your problem continue unsolved.
Probably an issue with igbinary, is this installed? (try for example: cat /etc/php.d/igbinary.ini).
Here you can find and install igbinary
Related to this bug https://bugs.launchpad.net/ubuntu/+source/php-redis/+bug/1762935
You should remove php-redis from packages:
apt purge php-redis , and install it via pecl install redis
You should add "extension=redis.so" to php.ini
and remove redis from config.d in your php directory:
rm /etc/php/7.2/fpm/conf.d/#20-redis.ini
and
rm /etc/php/7.2/cli/conf.d/#20-redis.ini
restart php fpm and you will see that problem solved
On Ubuntu 20 and PHP 7.4
I did this and it worked :
sudo apt purge php-redis
sudo apt intall php-redis php7.4-redis
TEST redis server :
$ php --ri redis
or
$ redis-cli ping
$ redis-cli info stats
just resolve the same problem:
php-pecl-redis installed by yum will cause this problem.
so you need to install the php-redis manually. wget the package and phpize - configure - make ....