COMPROBAMOS VERSIONES EN EL SISTEMA:
update-alternatives --config php
VEMOS LOS PAQUETES INSTALADOS:
dpkg -l | grep php7
ii libapache2-mod-php7.2 7.2.24-0ubuntu0.18.04.15 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php7.2 7.2.24-0ubuntu0.18.04.15 all server-side, HTML-embedded scripting language (metapackage)
ii php7.2-cli 7.2.24-0ubuntu0.18.04.15 amd64 command-line interpreter for the PHP scripting language
ii php7.2-common 7.2.24-0ubuntu0.18.04.15 amd64 documentation, examples and common module for PHP
ii php7.2-curl 7.2.24-0ubuntu0.18.04.15 amd64 CURL module for PHP
ii php7.2-dev 7.2.24-0ubuntu0.18.04.15 amd64 Files for PHP7.2 module development
ii php7.2-fpm 7.2.24-0ubuntu0.18.04.15 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php7.2-gd 7.2.24-0ubuntu0.18.04.15 amd64 GD module for PHP
ii php7.2-intl 7.2.24-0ubuntu0.18.04.15 amd64 Internationalisation module for PHP
ii php7.2-json 7.2.24-0ubuntu0.18.04.15 amd64 JSON module for PHP
ii php7.2-mbstring 7.2.24-0ubuntu0.18.04.15 amd64 MBSTRING module for PHP
ii php7.2-mysql 7.2.24-0ubuntu0.18.04.15 amd64 MySQL module for PHP
ii php7.2-opcache 7.2.24-0ubuntu0.18.04.15 amd64 Zend OpCache module for PHP
ii php7.2-readline 7.2.24-0ubuntu0.18.04.15 amd64 readline module for PHP
ii php7.2-xml 7.2.24-0ubuntu0.18.04.15 amd64 DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii php7.2-zip 7.2.24-0ubuntu0.18.04.15 amd64 Zip module for PHP
DESINSTALAMOS PHP:
apt-get purge 'php*' <- Elimina también los ficheros de configuración, hacer copia antes.
INSTALAMOS REPO PPA ONDREJ:
add-apt-repository ppa:ondrej/php
INSTALAMOS PHP y PHP-FPM:
apt install php7.4 php7.4-fpm
DESCOMENTAMOS:
En el fichero /etc/php/7.X/fpm/pool.d/www.conf:
;security.limit_extensions = .php .php3 .php4 .php5 .php7 <- Quitar el punto y coma
security.limit_extensions = .php .html <- Se queda así
ACTUALIZAMOS APACHE
a2enmod proxy_fcgi setenvif
a2enconf php7.4-fpm
systemctl restart apache2 / service apache2 restart
REINICIAMOS PHP-FPM
systemctl restart php7.4-fpm -> /Config en: etc/php/7.4/fpm/php.ini
systemctl status php7.4-fpm
COMPROBAMOS VERSION Y SERVICIO FPM:
php -v
ps ax -> php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
TERMINAMOS DE INSTALAR:
apt install php7.4-curl php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-zip php7.4-bcmath php7.4-cli php7.4-apcu php7.4-memcached