Alma/Rocky/CentOS
Acciones básicas
- Antes de actualizar PHP, si Passwork está instalado en un entorno en la nube/virtual, cree una instantánea del estado del sistema operativo virtual para restaurar la funcionalidad en caso de una actualización incorrecta;
- Obtenga privilegios de
rooty actualice la base de datos de paquetes local:
- shell
sudo -i
dnf update
Eliminación de PHP
Elimine el paquete principal, los controladores y las extensiones de PHP:
- shell
dnf remove -y php php-json php-ldap php-xml php-bcmath php-mbstring php-curl php-phalcon gcc php-pear curl-devel openssl-devel pcre-devel php-devel php-mysql libtool pcre-devel php-pecl-psr
Elimine el directorio con los archivos PHP anidados:
- shell
rm -rf /etc/php.d
Desactive el módulo PHP del repositorio Remi:
- 8.2
- 8.0
dnf module disable php:remi-8.2
dnf module disable php:remi-8.0
Instalación de PHP
Habilite el módulo PHP8.3 del repositorio Remi:
- shell
dnf module enable php:remi-8.3
Instale PHP y las extensiones adicionales:
- shell
dnf install -y php-cli php-fpm php-curl php-devel php-pear php-gd php-intl php-ldap php-bcmath php-mbstring php-mysqlnd php-opcache php-pgsql php-soap php-zip php-sqlite3 php-xml
Instalación del controlador PHP MongoDB
Instale el controlador PHP MongoDB:
- shell
pecl install -f mongodb
Cree un archivo de configuración para cargar y habilitar PHP MongoDB:
- shell
echo "extension=mongodb.so" | tee /etc/php.d/20-mongodb.ini
Cambio del manejador PHP del servidor web a php-fpm
Asegúrese de que el servicio php-fpm esté en ejecución:
- shell
systemctl status php-fpm
Inicie y habilite el inicio automático del servicio si está detenido:
- shell
systemctl start php-fpm
systemctl enable php-fpm
Edite el host virtual del servidor Passwork configurado para funcionar sobre el protocolo HTTPS:
- shell
nano /etc/httpd/conf.d/ssl.conf
Cambie el manejador de archivos .php especificando el proxy de solicitudes al socket php-fpm:
- shell
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/"
</FilesMatch>
Verifique que el archivo de configuración del host virtual coincida con el ejemplo:
- shell
<VirtualHost _default_:443>
DocumentRoot "/var/www/public"
ServerName passwork:443
<Directory /var/www/public>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLHonorCipherOrder on
SSLCipherSuite PROFILE=SYSTEM
SSLProxyCipherSuite PROFILE=SYSTEM
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/"
</FilesMatch>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
Reinicie los servicios:
- shell
systemctl restart php-fpm
systemctl restart httpd