Difference between revisions of "Pandora: Documentation en: PHP 7"

From Pandora FMS Wiki
Jump to: navigation, search
(Prerrequisitos)
(Ubuntu)
Line 181: Line 181:
 
=== Ubuntu ===
 
=== Ubuntu ===
  
Para poder actualizar a php7 es necesario añadirlo al respositorio mediante el siguiente mandato:
+
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  
 
  sudo add-apt-repository ppa:ondrej/php  
Una vez realizado este paso, tendremos que realizar un update para que se instale:
+
Once this step is done, we will have to do an update to install it:
 
  sudo apt-get update
 
  sudo apt-get update
  
Para asegurarnos de que todos los paquetes de apache se han instalado correctamente, y para confirmar que apache podrá ejecutarse con la nueva versión, ejecutaremos también:
+
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
 
  sudo apt-get install php7.0
  
Y lo mismo para MySQL:
+
And the same for MySQL:
  
 
  sudo apt-get install php7.0-mysql
 
  sudo apt-get install php7.0-mysql

Revision as of 14:40, 23 November 2018

Template wip.png

We are working on the translation of the Pandora FMS documentation. Sorry for any inconvenience.

 


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.

Info.png

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


VersionLinuxNada.png



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


Epel.png





Remi.png



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


Yum manager.png



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


Yum Install php.png



And we check the installed version



Version 7 php.png



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


Librerias 7 php.png



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.



DescargaPhp7.jpg



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:



Httpd-php.png




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


Removephp.png



We checked that we have correctly removed php using the command:

php –v


VersionLinuxNada.png



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


Epel.png





Remi.png



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


Yum manager.png



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


Yum Install php.png



And we check the installed version



Version 7 php.png



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


Librerias 7 php.png



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.



DescargaPhp7.jpg



Once the zip is downloaded, we'll unzip it in the folder C:\php.



DescompilarPhp7.jpg



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.



CambioCarpeta.png



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:




Httpd-php.png



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

Template warning.png

Es posible que con versiones antiguas de Suse u Opensuse no estén disponibles los paquetes de php7

 


Para instalar php 7 y sus extensiones tendremos que usar el siguiente mandato:

sudo zypper install php7 php7-mysql apache2-mod_php7

Una vez instalados, tendremos que activar el módulo de php7 y reiniciar el servidor Apache:

sudo a2enmod php7
sudo systemctl restart apache2

Go back to Pandora FMS documentation index