Skip to content

Instantly share code, notes, and snippets.

@reina3596
Forked from mrl22/README.md
Last active June 30, 2022 20:01
Show Gist options
  • Save reina3596/ea63913f34d1d9ac41e56a6a850a8acb to your computer and use it in GitHub Desktop.
Save reina3596/ea63913f34d1d9ac41e56a6a850a8acb to your computer and use it in GitHub Desktop.
Instalar y usar PHP 8.1 con Apache and NGINX en Moss.sh

Cambiar los datos necesarios

Instalar sitio web seleccionando la versión de PHP 7.4.

Instalación de php 8.1 vía apt

apt install php8.1-bcmath php8.1-bz2 php8.1-cli php8.1-common php8.1-curl php8.1-dev php8.1-fpm php8.1-imap php8.1-intl php8.1-mbstring php8.1-mysql php8.1-opcache php8.1-pgsql php8.1-readline php8.1-soap php8.1-sqlite3 php8.1-xml php8.1-xmlrpc php8.1-zip

Configurar php 8.1 para el usuario del sitio, normalmente en mi caso siempre "aws"

cp /etc/php/8.1/fpm/pool.d/www.conf /etc/php/8.1/fpm/pool.d/aws.conf
sed -i 's/\[www\]/\[aws\]/g' /etc/php/8.1/fpm/pool.d/aws.conf
sed -i 's/www-data/aws/g' /etc/php/8.1/fpm/pool.d/aws.conf
sed -i 's/php8.1-fpm/php8.1-fpm-aws/g' /etc/php/8.1/fpm/pool.d/aws.conf

Reiniciamos php-fpm

service php8.1-fpm reload

Hay que cambiar la configuración del sitio para pasar de php 7.4 a 8.1, siempre utilizando el nombre del sitio (no el dominio)

Apache

sed -i 's/php7.4-fpm-aws/php8.1-fpm-aws/g' /etc/apache2/sites-enabled/misitio.conf

Reiniciamos Apache

service apache2 restart

NGINX/OpenResty

sed -i 's/php7.4-fpm-aws/php8.1-fpm-aws/g' /usr/local/openresty/nginx/sites/misitio.conf

Reiniciamos OpenResty

service openresty restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment