Difference between revisions of "Pandora: Documentation en: PHP 7"
(→Prerrequisitos) |
|||
Line 178: | Line 178: | ||
[[image:httpd-php.png]] | [[image:httpd-php.png]] | ||
</center><br><br> | </center><br><br> | ||
+ | |||
+ | === Ubuntu === | ||
+ | |||
+ | Para poder actualizar a php7 es necesario añadirlo al respositorio mediante el siguiente mandato: | ||
+ | sudo add-apt-repository ppa:ondrej/php | ||
+ | Una vez realizado este paso, tendremos que realizar un update para que se instale: | ||
+ | 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: | ||
+ | |||
+ | sudo apt-get install php7.0 | ||
+ | |||
+ | Y lo mismo para MySQL: | ||
+ | |||
+ | sudo apt-get install php7.0-mysql | ||
+ | |||
+ | === Suse === | ||
+ | |||
+ | {{Warning|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 | ||
[[Pandora:Documentation en|Go back to Pandora FMS documentation index]] | [[Pandora:Documentation en|Go back to Pandora FMS documentation index]] |
Revision as of 10:06, 23 November 2018
Contents
1 Prerrequisitos
La instalación de PHP7 se debe de realizar con los rpm/deb/OUM ... de la consola en la versión 729 o posterior instalados. En caso contrario Pandora FMS nos dará un conflicto de dependencias debido a que para versiones anteriores nos pide PHP5.
En caso de instalar de la 728 a la 729, si tenemos el repositorio de PHP7 configurado en nuestro sistema, nos intentará instalar automáticamente dicho repositorio al actualizar la consola |
|
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
Para poder actualizar a php7 es necesario añadirlo al respositorio mediante el siguiente mandato:
sudo add-apt-repository ppa:ondrej/php
Una vez realizado este paso, tendremos que realizar un update para que se instale:
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:
sudo apt-get install php7.0
Y lo mismo para MySQL:
sudo apt-get install php7.0-mysql
2.2.4 Suse
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