Difference between revisions of "Pandora: Documentation en: PHP 7"
(→Ubuntu) |
(→Suse) |
||
Line 196: | Line 196: | ||
=== Suse === | === Suse === | ||
− | {{Warning| | + | {{Warning|With older versions of Suse or Opensuse, php7 packages may not be available.}} |
− | + | To install php 7 and its extensions we will have to use the following command: | |
sudo zypper install php7 php7-mysql apache2-mod_php7 | sudo zypper install php7 php7-mysql apache2-mod_php7 | ||
− | + | Once installed, we will have to activate the php7 module and restart the Apache server: | |
sudo a2enmod php7 | sudo a2enmod php7 |
Revision as of 14:56, 23 November 2018
Contents
1 Prerequisites
PHP7 installation must be done with rpm/deb/OUM ... of the console in version 729 or later. Otherwise Pandora FMS will experience a dependencies conflict since it requires PHP5 for previous versions.
In case of installing from 728 to 729, if we have the PHP7 repository configured in our system, it will try to install that repository automatically when updating the console. |
|
2 Installing & updating PHP 7
2.1 PHP 7 Installation
2.1.1 CentOS
First, we'll check that there is no previous version of php installed on the machine using the command from:
php –v
Once verified that we have uninstalled correctly php, we will download the repositories of epel and remi with the latest versions to install:
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
For CentOS 6 versions, we will download it from here:
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm # yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Next, we'll install yum-utils in case of not having installed it previously in our machine to be able to use the command yum-config-manager:
yum-config-manager --enable remi-php72
Finally, we'll install version php7.2 on our system:
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-snmp php-mbstring
And we check the installed version
For the correct operation of Pandora FMS with PHP version 7.2, we will need to add some PHP packages that are:
yum install php-xmlrpc libkslt php-xml
2.1.2 Windows
In the first place, we must go to the website https://windows.php.net/download/ to download the PHP 7.2 version we need. In our case we'll download the version VC15 x64 Thread Safe.
Once the zip is downloaded, we'll unzip it in the folder C:\php.
When the folder is created, we'll copy the file php.ini-production and rename it as php.ini.
To finish, we must change the httpd-php.conf file, and change the LoadFile and LoadModule to this:
2.2 PHP 7 Update
2.2.1 CentOS
In the first place, we must check that we have installed any version of php, which we must uninstall before we can proceed with the installation of php7:
sudo yum remove php-cli mod_php php-common
We checked that we have correctly removed php using the command:
php –v
Once verified that we have uninstalled php correctly, we will download the repositories of epel and remi with the latest versions to install:
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
For CentOS 6 versions, we will download it from here:
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm # yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Next, we'll install yum-utils in case we don't have it previously installed in our machine to be able to use the command yum-config-manager:
yum-config-manager --enable remi-php72
Finally, we'll install the php7.2 version on our system:
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-snmp php-mbstring
And we check the installed version
For the correct operation of Pandora FMS with PHP version 7.2, we will need to add some PHP packages which are:
yum install php-xmlrpc libkslt php-xml
If we had some version of Pandora FMS installed in our machine, we will have to reinstall the Pandora FMS console for its correct operation, due to the changes of PHP version, as we can see in the following link.
2.2.2 Windows
First, we must go to the website: https://windows.php.net/download/ to download the PHP 7.2 version we need. In our case we'll download the version VC15 x64 Thread Safe.
Once the zip is downloaded, we'll unzip it in the folder C:\php.
Next, we'll go to the folder located in C:\PandoraFMS\php, and rename it to php_versionActual and copy the new php folder we've created.
When the folder is created, we'll copy the file php.ini-production and rename it as php.ini.
After finishing this step, we will have to copy the file libsals.dll y reemplazaarlo fror the same file in the Apache folder C:\PandoraFMS\Apache\bin.
The installation of Microsoft Visual C++ 2015: https://www.microsoft.com/en-us/download/details.aspx?id=48145 will also be necessary for Pandora FMS to properly function.
To finish, we must change the httpd-php.conf file, and change the LoadFile and LoadModule to this:
2.2.3 Ubuntu
In order to upgrade to php7 it is necessary to add it to the repository using the following command:
sudo add-apt-repository ppa:ondrej/php
Once this step is done, we will have to do an update to install it:
sudo apt-get update
To make sure that all apache packages have been installed correctly, and to confirm that apache will be able to run with the new version, we will run as well the following command:
sudo apt-get install php7.0
And the same for MySQL:
sudo apt-get install php7.0-mysql
2.2.4 Suse
To install php 7 and its extensions we will have to use the following command:
sudo zypper install php7 php7-mysql apache2-mod_php7
Once installed, we will have to activate the php7 module and restart the Apache server:
sudo a2enmod php7 sudo systemctl restart apache2