PHP Update bzw mehrere Versionen


apt install php7.3 php7.3-cli php7.3-common
apt install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json

apt install php7.4 php7.4-common php7.4-cli
apt install php7.4-cli php7.4-fpm php7.4-json php7.4-pdo php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath php7.4-json

apt install php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-pspell php7.3-readline php7.3-recode php7.3-soap php7.3-sqlite3 php7.3-tidy php7.3-xml php7.3-xmlrpc php7.3-zip

7430 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig5 php7.4-common php7.4-json php7.4-readline php7.4-xml
7431 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache php7.4-common php7.4-json php7.4-readline php7.4-xml
7432 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig7 php7.4-common php7.4-json php7.4-readline php7.4-xml
7433 apt-cache search libonig*
7434 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig4 php7.4-common php7.4-json php7.4-readline php7.4-xml
7435 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig5 php7.4-common php7.4-json php7.4-readline php7.4-xml
7436 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig6 php7.4-common php7.4-json php7.4-readline php7.4-xml
7437 apt-get install php-memcache php-memcached
7438 a2enmod proxy_fcgi setenvif
7439 a2enconf php7.4-fpm
7440 apt-get install php-xdebug
7441 systemctl apache2 restart
7442 systemctl restart apache2

update-alternatives --config php

7469 php -i
7470 php -i | grep debug
7471 apt remove roundcube
7472 apt remove roundcube*
7473 apt autoremove
7474 systemctl reload apache2
7475 apt install php7.3-fcgi
7476 apt install php7.3-cgi
7477 apt install php7.3-*
7478 update-alternatives --config php
7479 systemctl reload apache2
7480 apt-get install roundcube roundcube-core roundcube-mysql roundcube-plugins
7481 a2enmod proxy_fcgi setenvif
7482 a2enconf php7.4-fpm
7483 systemctl reload apache2
7484 mc -e /etc/roundcube/config.inc.php
7485 mc -e /etc/apache2/conf-enabled/roundcube.conf
7486 service apache2 reload
7487 cat /etc/apache2/conf-enabled/roundcube.conf
7488 cat /etc/roundcube/config.inc.php
7489 update-alternatives --config php
7490 whois 8080
7491 whereis 8080
7492 whatis 8080
7493 php -v
7494 service apache2 restart
7495 history | grep mcrypt
7496 apt-get install php7.4-mcrypt
7497 apt-get install php7.3-mcrypt
7498 apt-get install php73-mcrypt
7499 apt-get install php7.3-mcrypt
7500 apt-get install php7*-mcrypt
7501 apt-get install php7.1-common php7.1-mcrypt
7502 apt-get remove php7.1-common php7.1-mcrypt
7503 apt-get install php7.3-common
7504 apt-get install php7.4-common
7505 update-alternatives --config php
7506 apt-get -y install gcc make autoconf libc-dev pkg-config
7507 apt-get -y install libmcrypt-dev
7508 pecl install mcrypt-1.0.1
7509 pecl install mcrypt-
7510 pecl install mcrypt
7511 apt-get install php7.3 php7.3-cli php7.3-cgi php7.3-fpm php7.3-gd php7.3-mysql php7.3-imap php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php7.3-zip php7.3-mbstring php7.3-soap php7.3-opcache php7.3-common php7.3-json php7.3-readline php7.3-xml
7512 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig5 php7.4-common php7.4-json php7.4-readline php7.4-xml
7513 apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache php7.4-common php7.4-json php7.4-readline php7.4-xml
7514 update-alternatives --config php
7515 php -v
7516 systemctl apache2 restart
7517 systemctl restart apache2
7518 history

root@dev:~# phpdismod xdebug
root@dev:~# service apache2 restart

apt install apt-transport-https
wget -q -O- https://packages.sury.org/php/apt.gpg | apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php.list
apt-get update

apt install php7.3 php7.3-cgi php7.3-cli php7.3-common php7.3-curl php7.3-fpm php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-readline php7.3-xml php7.3-zip

sudo apt-get install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json
apt-get install libapache2-mod-php7.3
apt-cache search php7.3
apt-get install php7.3-erweiterungsname (Beispiel: php7.3-mysql)

https://php.watch/articles/Ubuntu-PHP-7.3

sudo apt install apt-transport-https lsb-release
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg # Download the signing key
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' # Add Ondrej's repo to sources list. sudo apt update
sudo apt install php7.3 php7.3-common php7.3-cli
apt install php7.3-bcmath php7.3-bz2 php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-mbstring php7.3-readline php7.3-xml php7.3-zip
Nginx and Apache with event MPM
1 apt install php7.3-fpm
Apache with prefork MPM
OR 2 apt install libapache2-mod-php7.3

apt purge php7.2 php7.2-common # Change 7.2 with whatever current version you have.

Path to the PHP FastCGI binary: php5-cgi
Path to the php.ini directory: /etc/php5/cgi/php.ini

Path to the PHP-FPM init script: php5-fpm
Path to the php.ini directory: /etc/php5/fpm/php.ini
Path to the PHP-FPM pool directory: /etc/php5/fpm/pool.d

PHP 5.6
Path to the PHP FastCGI binary: php-cgi5.6
Path to the php.ini directory: /etc/php/5.6/cgi/php.ini
Path to the PHP-FPM init script: php5.6-fpm
Path to the php.ini directory: /etc/php/5.6/fpm/php.ini
Path to the PHP-FPM pool directory: /etc/php/5.6/fpm/pool.d
The cli version for e.g. cron jobs has the name php5.6.

PHP 7.0
Path to the PHP FastCGI binary: php-cgi7.0
Path to the php.ini directory: /etc/php/7.0/cgi/php.ini
Path to the PHP-FPM init script: php7.0-fpm
Path to the php.ini directory: /etc/php/7.0/fpm/php.ini
Path to the PHP-FPM pool directory: /etc/php/7.0/fpm/pool.d
The cli version for e.g. cron jobs has the name php7.0.

PHP 7.1
Path to the PHP FastCGI binary: php-cgi7.1
Path to the php.ini directory: /etc/php/7.1/cgi/php.ini
Path to the PHP-FPM init script: php7.1-fpm
Path to the php.ini directory: /etc/php/7.1/fpm/php.ini
Path to the PHP-FPM pool directory: /etc/php/7.1/fpm/pool.d
The cli version for e.g. cron jobs has the name php7.1.

PHP 7.2
Path to the PHP FastCGI binary: php-cgi7.2
Path to the php.ini directory: /etc/php/7.2/cgi/php.ini
Path to the PHP-FPM init script: php7.2-fpm
Path to the php.ini directory: /etc/php/7.2/fpm/php.ini
Path to the PHP-FPM pool directory: /etc/php/7.2/fpm/pool.d
The cli version for e.g. cron jobs has the name php7.2.

PHP 7.3
Path to the PHP FastCGI binary: php-cgi7.3
Path to the php.ini directory: /etc/php/7.3/cgi/php.ini
Path to the PHP-FPM init script: php7.3-fpm
Path to the php.ini directory: /etc/php/7.3/fpm/php.ini
Path to the PHP-FPM pool directory: /etc/php/7.3/fpm/pool.d
The cli version for e.g. cron jobs has the name php7.3.

PHP 7.4
Path to the PHP FastCGI binary: php-cgi7.4
Path to the php.ini directory: /etc/php/7.4/cgi/php.ini
Path to the PHP-FPM init script: php7.4-fpm
Path to the php.ini directory: /etc/php/7.4/fpm/php.ini
Path to the PHP-FPM pool directory: /etc/php/7.4/fpm/pool.d
The cli version for e.g. cron jobs has the name php7.4.

apt-get install -y apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update
apt-get upgrade

5.1 Install PHP 5.6
To install PHP use this command:

apt-get install php5.6 php5.6-cli php5.6-cgi php5.6-fpm php5.6-gd php5.6-mysql php5.6-imap php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip php5.6-mbstring php5.6-soap php5.6-opcache libicu65 php5.6-common php5.6-json php5.6-readline php5.6-xml
5.2 Install PHP 7.0
To install PHP use this command:

apt-get install php7.0 php7.0-cli php7.0-cgi php7.0-fpm php7.0-gd php7.0-mysql php7.0-imap php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-zip php7.0-mbstring php7.0-soap php7.0-opcache php7.0-common php7.0-json php7.0-readline php7.0-xml
5.3 Install PHP 7.1
To install PHP use this command:

apt-get install php7.1 php7.1-cli php7.1-cgi php7.1-fpm php7.1-gd php7.1-mysql php7.1-imap php7.1-curl php7.1-intl php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-xmlrpc php7.1-xsl php7.1-zip php7.1-mbstring php7.1-soap php7.1-opcache php7.1-common php7.1-json php7.1-readline php7.1-xml
5.4 Install PHP 7.2
To install PHP use this command:

apt-get install php7.2 php7.2-cli php7.2-cgi php7.2-fpm php7.2-gd php7.2-mysql php7.2-imap php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-zip php7.2-mbstring php7.2-soap php7.2-opcache php7.2-common php7.2-json php7.2-readline php7.2-xml
5.5 Install PHP 7.3
To install PHP use this command:

apt-get install php7.3 php7.3-cli php7.3-cgi php7.3-fpm php7.3-gd php7.3-mysql php7.3-imap php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php7.3-zip php7.3-mbstring php7.3-soap php7.3-opcache php7.3-common php7.3-json php7.3-readline php7.3-xml
5.6 Install PHP 7.4
To install the lastest PHP version use this command:

apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig5 php7.4-common php7.4-json php7.4-readline php7.4-xml
6 Install Memcache extension (optional)
To install Memcache use this command:

apt-get install php-memcache php-memcached
7 Install APCu extension (optional)
To install APC user cache use this command:

apt-get install php-apcu php-apcu-bc
8 Install xDebug extension (optional)
The xDebug module is a debugging extension for PHP. The installation is optional.

To install xDebug use this command:

apt-get install php-xdebug
This package seems to have other default settings than the Debian package php5-xdebug. Depending on your software you have to change settings like xdebug.max_nesting_level to get it running!

9 Set Debian default PHP back to the original version
The default PHP of the operating system has to remain at the original version. To fix that, run these commands:

update-alternatives --config php
update-alternatives --config php-cgi
On Debian 10, choose 7.3, on Debian 9: Choose PHP 7.0, on Debian 8, choose PHP 5.6 in the dialog that appears.

10 Restart FPM daemon
Finally, restart the php-fpm daemons. Run the commands for the previously installed ones:

service php5.6-fpm restart
service php7.0-fpm restart
service php7.1-fpm restart
service php7.2-fpm restart
service php7.3-fpm restart
service php7.4-fpm restart

php > 7.3. 0 pecl install mcrypt-1.0.2
php <= 7.3.0 sudo pecl install mcrypt-1.0.1 more /opt/bitnami/php/etc/php.ini | grep mcrypt