Difference between revisions of "PHP7.x RHEL"
(Created page with "Due to the fact that RHEL 7 is standard "supplied" with a PHP 5.4 version, which is no longer maintained. it is not possible to native install a PHP 7.0 or PHP 7.1 environment...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Due to the fact that RHEL 7 is standard "supplied" with a PHP 5.4 version, which is no longer maintained. it is not possible to native install a PHP 7.0 or PHP 7.1 environment. | Due to the fact that RHEL 7 is standard "supplied" with a PHP 5.4 version, which is no longer maintained. it is not possible to native install a PHP 7.0 or PHP 7.1 environment. | ||
But, there is the possibility to use the PHP 7.X versions which RedHat supplies through the SCL ( Software Collections Library). | But, there is the possibility to use the PHP 7.X versions which RedHat supplies through the SCL ( Software Collections Library). | ||
+ | '''Be aware that PHP5.6.x and PHP7.X will not operate with the default apache/http package, you also need the SCL HTTP24 version''' | ||
The Software Collections Library repository is available through the WUR Satellite environment. | The Software Collections Library repository is available through the WUR Satellite environment. | ||
+ | |||
+ | use subscription manager to enable the repository: | ||
+ | |||
+ | <nowiki>sudo subscription-manager repos --enable=rhel-server-rhscl-7-rpms</nowiki> | ||
+ | |||
+ | Now the proper packages can be installed ( and maintained ) through the Yum Package manager: | ||
+ | <nowiki>sudo yum install httpd24 httpd24-mod_ssl rh-php70 rh-php70-php</nowiki> | ||
+ | |||
+ | Now the whole new daemon chain is installed in /opt/rh. | ||
+ | In order to start the web-service with the new daemon first disable the "original" httpd service: | ||
+ | |||
+ | <nowiki>sudo systemctl stop httpd && sudo systemctl disable httpd</nowiki> | ||
+ | |||
+ | Next enable the new httpd24 daemon: | ||
+ | <nowiki>sudo systemctl enable httpd24-httpd</nowiki> | ||
+ | |||
+ | Copy ( or symlink) the original document root to the proper location: | ||
+ | <nowiki>sudo cp -pr /var/www/html/* /opt/rh/httpd24/root/var/www/html/</nowiki> | ||
+ | |||
+ | to test if the proper php version is active, you can insert a small phpinfo file: | ||
+ | <nowiki><?php phpinfo(); ?></nowiki> | ||
+ | |||
+ | Start the httpd24 service: | ||
+ | <nowiki>sudo systemctl start httpd24-httpd</nowiki> | ||
+ | |||
+ | '''Be aware that not all prePHP7 code can be run through PHP7.x''' |
Latest revision as of 12:25, 27 February 2018
Due to the fact that RHEL 7 is standard "supplied" with a PHP 5.4 version, which is no longer maintained. it is not possible to native install a PHP 7.0 or PHP 7.1 environment. But, there is the possibility to use the PHP 7.X versions which RedHat supplies through the SCL ( Software Collections Library). Be aware that PHP5.6.x and PHP7.X will not operate with the default apache/http package, you also need the SCL HTTP24 version
The Software Collections Library repository is available through the WUR Satellite environment.
use subscription manager to enable the repository:
sudo subscription-manager repos --enable=rhel-server-rhscl-7-rpms
Now the proper packages can be installed ( and maintained ) through the Yum Package manager:
sudo yum install httpd24 httpd24-mod_ssl rh-php70 rh-php70-php
Now the whole new daemon chain is installed in /opt/rh. In order to start the web-service with the new daemon first disable the "original" httpd service:
sudo systemctl stop httpd && sudo systemctl disable httpd
Next enable the new httpd24 daemon:
sudo systemctl enable httpd24-httpd
Copy ( or symlink) the original document root to the proper location:
sudo cp -pr /var/www/html/* /opt/rh/httpd24/root/var/www/html/
to test if the proper php version is active, you can insert a small phpinfo file:
<?php phpinfo(); ?>
Start the httpd24 service:
sudo systemctl start httpd24-httpd
Be aware that not all prePHP7 code can be run through PHP7.x