KB Article #182139
Install dependencies from RedHat Software Collections on RHEL 7
How to Install dependencies from RedHat Software Collections on RHEL 7
On a Red Hat Enterprise Linux (RHEL7) installation, the default PHP version available in the official repository is 5.4. However, API Portal only supports PHP 7.1.X-7.4.X. You can use RedHat Software Collections (RHSCL) to install PHP 7.1.X-7.4.X.
Enable RedHat Software Collections
Before installing Apache HTTP server and PHP you must first enable RHSCL:
sudo subscription-manager repos --enable rhel-server-rhscl-7-rpms sudo yum clean all
Install Apache HTTP server on RHEL7
- Install Apache from RHSCL:
sudo yum install httpd24-httpd httpd24-httpd-tools httpd24-mod_ssl
- Verify the /usr/bin/httpd directory does not exist. If it does, rename it and run:
sudo ln -s <span class="pl-s"><span class="pl-pds">$(</span>which httpd<span class="pl-pds">)</span></span> /usr/bin/httpd
- Make Apache available in any bash session by default:
<span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">"</span>source scl_source enable httpd24<span class="pl-pds">"</span></span> <span class="pl-k">|</span> sudo tee -a /etc/profile.d/scl-httpd24.sh <span class="pl-c1">source</span> /etc/profile.d/scl-httpd24.sh sudo ln -s <span class="pl-s"><span class="pl-pds">$(</span>which httpd<span class="pl-pds">)</span></span> /usr/bin/httpd
- Verify Apache is now available:
httpd -v
- Enable and start Apache service:
sudo systemctl <span class="pl-c1">enable</span> --now httpd24-httpd
- Verify that Apache service is active and running:
systemctl status httpd24-httpd
You must install the latest PHP version provided by the RHSCL.
- Install all required PHP packages:
sudo yum install rh-php73 rh-php73-php rh-php73-php-cli rh-php73-php-common rh-php73-php-gd rh-php73-php-json rh-php73-php-intl rh-php73-php-mbstring rh-php73-php-mysqlnd rh-php73-php-pdo rh-php73-php-xml rh-php73-php-zip
- Verify the /usr/bin/httpd directory does not exist. If it does, rename it and run:
sudo ln -s <span class="pl-s"><span class="pl-pds">$(</span>which httpd<span class="pl-pds">)</span></span> /usr/bin/httpd
- Enable PHP in bash:
<span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">"</span>source scl_source enable rh-php73<span class="pl-pds">"</span></span> <span class="pl-k">|</span> sudo tee -a /etc/profile.d/scl-rh-php73.sh <span class="pl-c1">source</span> /etc/profile.d/scl-rh-php73.sh sudo ln -s <span class="pl-s"><span class="pl-pds">$(</span>which php<span class="pl-pds">)</span></span> /usr/bin/php
If /usr/bin/php already exists, please rename it and execute againsudo ln -s <span class="pl-s"><span class="pl-pds">$(</span>which php<span class="pl-pds">)</span></span> /usr/bin/php
- Verify that PHP is available:
php -v
- Verify that php7_module is enabled in Apache:
httpd -M <span class="pl-k">|</span> grep php7
- Restart Apache and verify it is running:
sudo systemctl restart httpd24-httpd systemctl status httpd24-httpd