Install Php8-dev on php:8.0.1-fpm-alpine - php

With Docker, i try to build some php extensions from sources.
In order to do that, i install php8-dev, but, after that, it's install also php8, so i have two different build of php8, causing break ldd for the .so
# php -v
PHP 8.0.1 (cli) (built: Jan 7 2021 21:27:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
with Zend OPcache v8.0.1, Copyright (c), by Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
# php8 -v
PHP 8.0.1 (cli) (built: Jan 10 2021 13:43:09) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
Below, a sample of my Dockerfile
FROM php:8.0.1-fpm-alpine
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community php8-dev
WORKDIR /srv
Any idea ?

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 ?

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 upgrade to xDebug to 2.3

I've installed the latest version of PHP (the 5.6.11 in this moment) using the package provided by Liip.
There, there is xDebug 2.5.5.
How can I upgrade to xDebug 2.3.*?
It was really simple:
$ sudo pecl install xdebug
Verify with:
$ php -v
PHP 5.6.11 (cli) (built: Jul 10 2015 22:36:04)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans

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.

PHP Fatal error: Class 'Memcached' not found in

php -v :
PHP 5.5.10-1+deb.sury.org~precise+1 (cli) (built: Mar 27 2014 16:18:01)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo
with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo
dpkg -l | grep php5
result
rc php5-memcache 3.0.6-1 memcache extension module for PHP5
rc php5-memcached 1.0.2-2 memcached extension module for PHP5, uses libmemcached
ii php5-mysql 5.5.10+dfsg-1+deb.sury.org~precise+1 MySQL module for php5
php.ini setting .
;;;;;;;;;;;;;;;;;;;;;;;;;
;; memchached ;;
;;;;;;;;;;;;;;;;;;;;;;;;;
extension=/usr/lib/php5/20090626/memcache.so
extension=memcached.so
memcache.hash_strategy="consistent"
but phpinfo not showing memchache details.
and php script giving PHP Fatal error: Class 'Memcached' not found in
php5-memcache and php5-memcached aren't installed. the "rc" in the dpkg output means, that the packages have been uninstalled, and that the configuration has been kept.
dpkg -l | grep php5 indicate that module is not install
ii means 'It should be installed and it is installed' whereas
rc means 'It's removed/uninstalled but it's configuration files are still there'
Use the following to install 'Memcache'
sudo apt-get install php5-memcache
Fatal error: Class 'Memcached' not found
the library might be missing, you can manually include the missing php_memcache into the ext folder

Categories