pecl install ampq failed - php

I want to create RabbitMQ clients and workers in PHP on my Ubuntu machine. These is the whole list of steps that I followed:
apt-get install aptitude
aptitude install libtool
aptitude install pkg-config
cd /tmp
rm -rf rabbitmq-c
git clone -b v0.5.2 git://github.com/alanxz/rabbitmq-c.git
cd rabbitmq-c
autoreconf -i && ./configure && make && make install
pecl install amqp-1.4.0
I took these steps from this thread. But when I run the last command, I get this error message:
No releases available for package "pecl.php.net/apmq"
So, what is wrong with that?
PS. PHP version is 5.6.4.

Related

Is Ubuntu 21.04 compatible with PHP sqlsrv driver?

I have a web system developed with PHP + MS Sql Server and I do maintenance on Windows environment. But I prefer working in Linux environment, Ubuntu to be more accurate.
But I cannot find a way to install this database driver. I googled but I cannot find any solution. Some tutorials shows how to install in 20.04, 18.04 versions, but even following the steps to the letter, I could no install.
Some tutorials that did not worked.
How to Install the PHP SQLSRV Extension
Linux and macOS Installation Tutorial for the Microsoft Drivers for PHP for SQL Server
Any suggestions?
It seems, at least today, that msodbcsql17 mssql-tools are not available in the Ubuntu 21.04 repos...
$ curl -s https://packages.microsoft.com/config/ubuntu/21.04/prod.list
deb [arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/21.04/prod hirsute main
$ curl -s https://packages.microsoft.com/ubuntu/21.04/prod/dists/hirsute/Contents-amd64.gz | gzip -d | grep -E "msodbcsql|mssql"
# No output.
As a result you'll get errors when you try to install them via apt-get:
$ curl -s https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
$ sudo bash -c "curl -s https://packages.microsoft.com/config/ubuntu/21.04/prod.list > /etc/apt/sources.list.d/mssql-release.list"
$ sudo apt-get update --yes
# ...
$ sudo ACCEPT_EULA=Y apt-get --verbose-versions --yes install msodbcsql17 mssql-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package msodbcsql17
E: Unable to locate package mssql-tools
Update
I have written a bash script to automatically install the appropriate drivers for Ubuntu or Debian: https://github.com/sfinktah/bash/blob/master/add_sqlsrv_repo_combined.sh
I couldn't test support for other Linux vendors, but the capability is there if someone wants to send a PR.
Original Post
21.04 drivers are now available.
Follow the instructions on
https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15 and https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#ubuntu17
Or as above:
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
#Download appropriate package for the OS version
#Choose only ONE of the following, corresponding to your OS version
# Automatic version selection (does not work for 21.10, but 20.10 or 21.04 are fine)
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -r -s)/prod.list > /etc/apt/sources.list.d/mssql-release.list
# Manual specification: Ubuntu 21.04
curl https://packages.microsoft.com/config/ubuntu/21.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev

Install php7.4-cgi in Debian 10

I`m using docker image php:7.4.3-apache and I need to install php7.4-cgi. Image is running on Debian 10. I was tried many tutorials but without success.
Etc. this tutorial https://kifarunix.com/install-php-7-4-on-debian-10-debian-9/
When I run installation command then I get following error:
root#eafa0aac715a:/usr/local/bin# apt install php7.4-cgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php7.4-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php7.4-cgi' has no installation candidate
I don`t known what I am doing bad.
I was created new clear dockerfile:
FROM php:7.4.3-apache
RUN apt-get -y install apt-transport-https lsb-release ca-certificates curl
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN apt-get update
RUN apt install php7.4-cgi
Is there somebody who can fix this dockerfile for build?
Did you correctly configure the repositories to be able to install php?. In my case I use the following repository to install the PHP packages:
https://packages.sury.org/php/
How can you configure it in Debian 10?
First install the necessary packages
apt-get -y install apt-transport-https lsb-release ca-certificates curl
Following this, add the GPG key
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
then you create a file with following command inside sources.list.d directory so apt use this repository when updating
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
and perform an apt-update
apt-get update
after this, you only have to install the package you were trying to install
apt install php7.4-cgi

Install MongoDB driver in Cent os 7 with php7.1

I have Centos 7 and php 7.1. I want to install pecl and I tried that with yum install pecl but it has a conflict with php5.4.
How can I install mongodb driver without pecl or how can I fix pecl to work with php7.1?
I used pecl to install the mongo driver.
yum install php-pear
pecl install mongodb
note that there's also an old mongo driver that works for php5 but mongodb driver is for php7
You can Install mongodb manually with following commands:
First install php71w-devel package with following command:
sudo yum install php71w-devel -y
and then you can install it manually.
$ git clone https://github.com/mongodb/mongo-php-driver.git
$ cd mongo-php-driver
$ git submodule sync && git submodule update --init
$ phpize
$ ./configure
$ make all -j 5
$ sudo make install
ref:http://php.net/manual/en/mongodb.installation.manual.php

facing error while install imagemagick Ubuntu 14.04

I am new to use ubuntu, to install imagemagick I have run below command
sudo apt-get update
but it showing error
I have executed below commands as well but not able to install
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
https://gist.github.com/rodleviton/74e22e952bd6e7e5bee1
Google has dropped the support for 32-bit version for chrome on Linux and that is the reason you are seeing that error.
Edit /etc/apt/sources.list.d/google-chrome.list - You would need sudo
Replace the existing line with deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
Run sudo apt-get update now.
And what is the error you are seeing when you are trying to install imagemagick?

How do you install Libevent for PHP?

I installed the libevent-dev library on my Debian 7 64bit desktop:
$ sudo aptitude install -y libevent-dev
Then I installed the PECL library
$ pecl list
Installed packages, channel pecl.php.net:
=========================================
Package Version State
libevent 0.1.0 beta
I've restarted PHP and the OS but PHP doesn't list libevent as an installed ext in with phpinfo() and I get "PHP Fatal error: Call to undefined function event_base_new()" when I try to use it.
How do you install Libevent?
Install Libevent for PHP 5.X
sudo apt-get install libevent-dev
sudo pecl install libevent-beta
sudo su
sudo echo 'extension=libevent.so' > /etc/php5/mods-available/libevent.ini
exit
sudo ln -s /etc/php5/mods-available/libevent.ini /etc/php5/fpm/conf.d/
sudo ln -s /etc/php5/mods-available/libevent.ini /etc/php5/cli/conf.d/
sudo service php5-fpm restart
Install Libevent for PHP 7.X
At this time pecl package libevent is not available for php 7
https://pecl.php.net/package/libevent
So let's compile it.
Download master:
https://github.com/expressif/pecl-event-libevent
Unpack to: /tmp/install_libevent
cd /tmp/install_libevent/pecl-event-libevent-master
sudo phpize
sudo ./configure
After this step scroll our console window and try find any Warnings or Errors. I got one warning - required to install re2c package.
sudo make
sudo make install
sudo su
sudo echo 'extension=libevent.so' > /etc/php/7.0/mods-available/libevent.ini
exit
sudo ln -s /etc/php/7.0/mods-available/libevent.ini /etc/php/7.0/fpm/conf.d/20-libevent.ini
sudo ln -s /etc/php/7.0/mods-available/libevent.ini /etc/php/7.0/cli/conf.d/20-libevent.ini
sudo service php7.0-fpm restart
I've successfully installed it.
These are the steps:
apt-get install libevent-dev
sudo pecl install libevent
Edit: Press enter when you are asked for the libevent installation directory (autodetect)
; Add extension=libevent.so in the *.ini file where you desire to load it. For example if you want this extension to be loaded always, create a libevent.ini file where your php5 mods are (in my computer they are in /etc/php5/mods-available/) and write extension=libevent.so. Enable this module then with php5enmod libevent. This page may help you.
Add extension=libevent.so to php.ini.

Categories