Difference between revisions of "Pandora: Documentation en: PHP 7"
(→CentOS) |
|||
Line 1: | Line 1: | ||
− | = | + | = Installing & updating PHP 7 = |
− | == | + | == PHP 7 Installation == |
=== CentOS === | === CentOS === | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | And we check the installed version | |
<center><br><br> | <center><br><br> | ||
Line 40: | Line 40: | ||
</center><br><br> | </center><br><br> | ||
− | + | 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 === | ||
− | + | 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> | ||
− | + | 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: | |
<center><br><br> | <center><br><br> | ||
Line 67: | Line 67: | ||
− | == | + | == PHP 7 Update == |
=== CentOS === | === 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 | sudo yum remove php-cli mod_php php-common | ||
Line 78: | Line 78: | ||
</center><br><br> | </center><br><br> | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | And we check the installed version | |
<center><br><br> | <center><br><br> | ||
Line 116: | Line 117: | ||
</center><br><br> | </center><br><br> | ||
− | + | 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> | ||
− | + | 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 === | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | 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> | ||
− | + | 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: | |
− | |||
<center><br><br> | <center><br><br> |
Revision as of 11:49, 8 November 2018
Contents
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
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
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
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.
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:
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
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
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.
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.
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: