How to install PHP74, NGINX & MariaDB en Centos8

NOTE: This installation was testing with a fresh installation of Centos8

1) Add yum-utils and REMI Repo.

dnf install yum-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
2) Change the default PHP distro:

dnf module enable php:remi-7.4
3) Install required packages.

dnf install nginx mariadb-server php74-php-fpm php74-php-pecl-imagick php74-php-pecl-pdflib php74-php-pecl-zip php74-php-pecl-rar php74-php-embedded php74-php-pecl-pq php74-php-opcache php74-php-odbc php74-php-ldap php74-php-json php74-php-intl php74-php-dba php74-php-cli php74-php-gd php74-php-pdo-dblib php74-php-mysqlnd php74-php-pecl-mysql php74-php-pgsql php74-php-oci8 php74-php-pdo

3) Start and add to boot the MySQL Server (MariaDB):

systemctl start mariadb
systemctl enable mariadb


3) Start and add to boot the php-fpm and nginx server:

systemctl restart nginx
systemctl enable nginx

systemctl restart php-fpm
systemctl enable php-fpm


4) Initial configuration for the MariaDB Server:

mysql_secure_installation

5) Edit php-fpm configuration file and change apache for nginx user:

vi /etc/php-fpm.d/www.conf

change the lines:

user = apache
group = apache

to

user = nginx
group = nginx

6) Ensure the files property in the /var/lib/php directory be correct:

chown -R root:nginx /var/lib/php

Comentarios

Entradas populares