Install PHP 5.6 on AlmaLinux 8
To install PHP 5.6 on AlmaLinux 8, first enable epel repository.
1 |
dnf install -y epel-release |
install remi repository with the command
1 |
dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm |
Now you can install PHP 5.6 with
1 |
dnf install php56 |
You can execute PHP with the command
1 |
php56 |
If you want PHP 5.6 to work with the command “php”, then edit
1 |
vi ~/.bashrc |
At end of the file, add
1 |
source /opt/remi/php56/enable |
Log off and login to the server or run command
‘
1 |
source /opt/remi/php56/enable |
Or you can create a symlink
1 |
ln -s /opt/remi/php56/root/usr/bin/php /usr/bin/php |
If you need PHP work with Apache, run install Apache with
1 |
dnf install httpd |
Install php-fpm with
1 |
dnf install php56-php-fpm |
Enable and restart Apache
1 2 3 4 |
systemctl enable php56-php-fpm systemctl enable httpd systemctl restart httpd systemctl restart php56-php-fpm |
php-fpm pool config file available at
1 |
/etc/opt/remi/php56/php-fpm.d/www.conf |