How to Install PHP 5.6 on Oracle Linux 7
Oracle Linux is a free RHEL based Linux distro. We will install PHP 5.6 on an Oracle Linux 7 server.
First, enable EPEL repo
1 |
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
Enable Remi repo
1 |
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm |
Install yum-utils package
1 |
yum install yum-utils |
Enable remi-php56
1 |
yum-config-manager --enable remi-php56 |
Install PHP 5.6 with
1 2 3 |
yum install -y php php-bcmath php-cli php-common php-devel php-gd \ php-imap php-intl php-json php-ldap php-lz4 php-mbstring php-mysqlnd \ php-soap php-intl php-opcache php-xml php-pdo |
This will only install the CLI version of PHP 5.6. To make Apache work with PHP 5.6, install
1 |
yum install php-pecl-http.x86_64 |
This will create file /etc/httpd/conf.d/php.conf, that enable PHP module in Apache.
Restart apache webserver
1 |
systemctl restart httpd |
Now Apache will be able to serve PHP files.