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

From Pandora FMS Wiki
Jump to: navigation, search
(CentOS)
Line 1: Line 1:
= Instalación y actualización de PHP 7 =
+
= Installing & updating PHP 7 =
== Instalación de PHP 7 ==
+
== PHP 7 Installation ==
 
=== CentOS ===
 
=== CentOS ===
En primer lugar, veremos que no existe ninguna versión anterior de php instalada en la máquina mediante el comando de:
+
First, we'll check that there is no previous version of php installed on the machine using the command from:
 
  '''php –v'''
 
  '''php –v'''
  
Line 9: Line 9:
 
</center><br><br>
 
</center><br><br>
  
Una vez comprobado que hemos desinstalados correctamente php, nos bajaremos los repositorios de epel y remi con las últimas versiones a instalar:
+
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 https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Line 20: Line 20:
 
</center><br><br>
 
</center><br><br>
  
A continuación, instalaremos '''yum-utils''' en el caso de que no lo tengamos instalado previamente en nuestra máquina para poder utilizar el comando '''yum-config-manager''':  
+
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-config-manager --enable remi-php72
  
Line 27: Line 27:
 
</center><br><br>
 
</center><br><br>
  
Finalmente instalaremos la versión php7.2 en nuestro sistema:  
+
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 php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-snmp php-mbstring
  
Line 34: Line 34:
 
</center><br><br>
 
</center><br><br>
  
Y comprobamos finalmente la versión instalada.
+
And we check the installed version
  
 
<center><br><br>
 
<center><br><br>
Line 40: Line 40:
 
</center><br><br>
 
</center><br><br>
  
Para el correcto funcionamiento de Pandora FMS con la versión 7.2 de PHP, necesitaremos añadir unos paquetes de PHP que son:
+
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
 
  yum install php-xmlrpc libkslt php-xml
Line 49: Line 49:
  
 
=== Windows ===
 
=== Windows ===
En primer lugar, debemos de desplazarnos a la siguiente página web: ''https://windows.php.net/download/'' para descargarnos la versión de PHP 7.2 que necesitemos, en nuestro caso nos bajaremos la versión '''VC15 x64 Thread Safe'''.
+
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'''.
  
 
<center><br><br>
 
<center><br><br>
Line 55: Line 55:
 
</center><br><br>
 
</center><br><br>
  
Una vez tengamos descargado el zip, lo descomprimiremos en la carpeta '''C:\php'''.
+
Once the zip is downloaded, we'll unzip it in the folder '''C:\php'''.
  
Una vez creada la carpeta, copiaremos el fichero ''php.ini-production'' y lo renombraremos a ''php.ini''.
+
When the folder is created, we'll copy the file ''php.ini-production'' and rename it as  ''php.ini''.
  
Para finalizar, se deberá de cambiar el fichero de ''httpd-php.conf'' y cambiar el ''LoadFile Y LoadModule'' a lo siguiente:
+
To finish, we must change the ''httpd-php.conf'' file,  and change the ''LoadFile and LoadModule'' to this:
  
 
<center><br><br>
 
<center><br><br>
Line 67: Line 67:
  
  
== Actualización de PHP 7 ==
+
== PHP 7 Update ==
  
 
=== CentOS ===
 
=== CentOS ===
  
En primer lugar, debemos comprobar que tenemos instalada la versión de php que sea, la cual deberemos de desinstalar antes de poder proceder con la instalación de php7:  
+
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
 
  sudo yum remove php-cli mod_php php-common
  
Line 78: Line 78:
 
</center><br><br>
 
</center><br><br>
  
Comprobamos que hemos removido correctamente php mediante el comando de:
+
We checked that we have correctly removed php using the command:
 
  '''php –v'''
 
  '''php –v'''
  
Line 85: Line 85:
 
</center><br><br>
 
</center><br><br>
  
Una vez comprobado que hemos desinstalados correctamente php, nos bajaremos los repositorios de epel y remi con las últimas versiones a instalar:
+
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 https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
 
  # yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
 
  # yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
 +
 
<center><br><br>
 
<center><br><br>
 
[[image:Epel.png]]
 
[[image:Epel.png]]
Line 96: Line 97:
 
</center><br><br>
 
</center><br><br>
  
A continuación, instalaremos '''yum-utils''' en el caso de que no lo tengamos instalado previamente en nuestra máquina para poder utilizar el comando '''yum-config-manager''':  
+
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-config-manager --enable remi-php72
  
Line 103: Line 104:
 
</center><br><br>
 
</center><br><br>
  
Finalmente instalaremos la versión php7.2 en nuestro sistema:  
+
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 php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-snmp php-mbstring
  
Line 110: Line 111:
 
</center><br><br>
 
</center><br><br>
  
Y comprobamos finalmente la versión instalada.
+
And we check the installed version
  
 
<center><br><br>
 
<center><br><br>
Line 116: Line 117:
 
</center><br><br>
 
</center><br><br>
  
Para el correcto funcionamiento de Pandora FMS con la versión 7.2 de PHP, necesitaremos añadir unos paquetes de PHP que son:
+
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
 
  yum install php-xmlrpc libkslt php-xml
Line 124: Line 125:
 
</center><br><br>
 
</center><br><br>
  
Si teníamos alguna versión de Pandora FMS instalada en nuestra máquina, deberemos de reinstalar la consola de Pandora FMS para un correcto funcionamiento de la misma, debido a los cambios de versión de PHP, como podemos ver en el siguiente [[Pandora:Documentation_en:Installing#Console_Installation_2|enlace]].
+
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 [[Pandora:Documentation_en:Installing#Console_Installation_2|link]].
  
 
=== Windows ===
 
=== Windows ===
En primer lugar, debemos de desplazarnos a la siguiente página web: ''https://windows.php.net/download/'' para descargarnos la versión de PHP 7.2 que necesitemos, en nuestro caso nos bajaremos la versión '''VC15 x64 Thread Safe'''.
+
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'''.
  
 
<center><br><br>
 
<center><br><br>
Line 133: Line 134:
 
</center><br><br>
 
</center><br><br>
  
Una vez tengamos descargado el zip, lo descomprimiremos en una carpeta llamada '''php'''.  
+
Once the zip is downloaded, we'll unzip it in the folder '''C:\php'''.
  
 
<center><br><br>
 
<center><br><br>
Line 139: Line 140:
 
</center><br><br>
 
</center><br><br>
  
A continuación, iremos a la carpeta localizada en '''C:\PandoraFMS\php''', y la renombraremos a '''php_versionActual''' y copiaremos la nueva carpeta php que hemos creado.
+
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.
  
 
<center><br><br>
 
<center><br><br>
Line 145: Line 146:
 
</center><br><br>
 
</center><br><br>
  
Una vez creada la carpeta, copiaremos el fichero ''php.ini-production'' y lo renombraremos a ''php.ini''.
+
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''.
  
Tras finalizar este paso, tendremos que copiar el fichero ''libsals.dll'' y reemplazaarlo por el mismo fichero en la carpeta de Apache ''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.
  
También será necesaria la instalación de '''Microsoft Visual C++ 2015''': ''https://www.microsoft.com/en-us/download/details.aspx?id=48145'' para el correcto funcionamiento de Pandora FMS.
+
To finish, we must change the ''httpd-php.conf'' file,  and change the ''LoadFile and LoadModule'' to this:
  
Para finalizar, se deberá de cambiar el fichero de ''httpd-php.conf'' y cambiar el ''LoadFile Y LoadModule'' a lo siguiente:
 
  
 
<center><br><br>
 
<center><br><br>

Revision as of 11:49, 8 November 2018

1 Installing & updating PHP 7

1.1 PHP 7 Installation

1.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


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



1.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




1.2 PHP 7 Update

1.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


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.

1.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



Go back to Pandora FMS documentation index