Install gRPC for PHP - php

I want to install gRPC for PHP 7.3. I followed Google Cloud documentation.
I use ubuntu 16.04, Nginx
I install:
sudo apt-get install autoconf zlib1g-dev php-dev php-pear
sudo pecl install grpc
But I am getting this error:
No releases available for package "pecl.php.net/grpc"
install failed
I don't know what is wrong.
It is php -v
PHP 7.3.22-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Sep 9 2020 06:46:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.22, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.22-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
Please, help me.

Related

Upgrade Php7.4 to php8 Ubuntu with Zend OPcache

How to upgrade the php version from v7.4 to v8.1. This machine is created from aws ect2 wordpress/bitnami instance.
bitnami#ip-172-31-xx-xxx:~$ php -v
PHP 7.4.22 (cli) (built: Aug 2 2021 07:35:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.22, Copyright (c), by Zend Technologies
I had alraedy tried below approach but its not upgrading with below commands
sudo apt-add-repository ppa:ondrej/php
sudo apt update
Any alternate solution to upgrade the php version ?

Error : When i try to install php 7 version on centos 7 but Package comes Php 5 version

When I try to install the PHP 7 version on my centos 7 but the Package comes from Php 5 version so I decided to change the repo rebel to Remi and disable the rebel after I got the below error
I started a Docker container using centos:7 and I ran the following commands:
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php74
yum -y update
yum -y install php
yum -y install php-fpm php-gd php-json php-mbstring php-mysqlnd php-xml php-xmlrpc php-opcache
Now let's see the phpversion.
sh-4.2# php -v
PHP 7.4.27 (cli) (built: Dec 14 2021 17:17:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies
sh-4.2# php-fpm -v
PHP 7.4.27 (fpm-fcgi) (built: Dec 14 2021 17:17:06)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies

Getting error "Class 'DOMDocument' not found" in PHP

I'm getting an error:
Symfony\Component\Debug\Exception\FatalThrowableError: Class 'DOMDocument' not found in /var/www/html/vendor/embed/embed/src/Request.php:246
I found online that I have to install php-xml and php-dom. First, I checked my php version:
/var/www/html# php -v
PHP 7.1.33-17+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Aug 7 2020 14:46:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.33-17+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
Then, I installed php-xml and php-dom:
sudo apt-get install php7.1-dom
sudo apt-get install php7.1-xml
And restarted nginx:
sudo service nginx restart
But it's still showing the first error. I'm three hours into this and it's driving me insane.

How to install xdebug in ubuntu 16.04 in netbeans?

Whenever I try to run this code
example#testserver:~$ sudo apt-get install php5-xdebug
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5-xdebug
I get this error "E: Unable to locate package php5-xdebug"
Please help
Thanks
If you're running the default apt installation of PHP on Ubuntu 16.04, then it should be PHP7. If I had to guess from php5-xdebug, then I'd say you were using a command intended for Ubuntu 14.04 or older where the default PHP installation was PHP5. You can verify your PHP version with:
php --version
This is what I see:
PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
At any rate, you should be able to search available packages for your configuration with:
apt search xdebug
From my relatively fresh Ubuntu 16.04 install without any added PPA's, I get one result:
php-xdebug - Xdebug Module for PHP
So you can install this package by name (note the missing "5" from your command):
sudo apt install php-xdebug
You might also have to restart your webserver. If you're running the stock build of Apache for Ubuntu 16.04:
sudo service apache2 restart

Cannot install mcrypt via homebrew OSX Yosemite

Running OSX 10.10.1. I installed homebrew, and then tried running the following command:
brew install mcrypt
After which, it went through a long process of downloading/installing files. It then gave me an error:
checking for mhash_keygen in -lmhash... no
configure: error: "You need at least libmhash 0.8.15 to compile this program.
http://mhash.sf.net/"
Running php -v in terminal:
PHP 5.6.2 (cli) (built: Nov 2 2014 09:34:41)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
Any help is appreciated. Everything seems to be breaking in OSX Yosemite...
I was experiencing the same issue and uninstalling / reinstalling mhash resolved the issue:
brew uninstall mhash
brew install mhash
After I did this I was able to properly install mcrypt.

Categories