Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:documentation:07_technical_annexes:14_php_7 [2021/05/20 20:03] admscopia |
en:documentation:07_technical_annexes:14_php_7 [2023/02/20 16:54] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Installing and updating PHP 7 ====== | ====== Installing and updating PHP 7 ====== | ||
+ | |||
{{indexmenu_n> | {{indexmenu_n> | ||
- | [[en: | + | [[:en: |
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | PHP7 installation | + | Consult about [[: |
+ | |||
+ | <WRAP center round tip 75%> | ||
+ | |||
+ | PHP 7.2 → For Pandora FMS versions | ||
- | <WRAP center round tip 60%> | ||
- | In case of updating from 728 to 729, if the PHP7 repository is configured in your system, it will try to install that repository automatically when updating the console. | ||
</ | </ | ||
+ | |||
+ | <WRAP center round tip 75%> | ||
+ | |||
+ | PHP7.4 → For Pandora FMS versions from 759 to 767. | ||
+ | |||
+ | </ | ||
+ | |||
+ | For version 760 (and later) of Pandora FMS visit " | ||
+ | |||
+ | ===== PHP 7 Installation ===== | ||
<WRAP center round tip 60%> | <WRAP center round tip 60%> | ||
- | Php version 7.2 or later is supported, it requires installing every dependency needed. | + | |
+ | Run as **root** | ||
</ | </ | ||
- | ===== Installing & updating PHP 7 ===== | ||
- | ==== PHP 7 Installation ==== | ||
=== CentOS === | === CentOS === | ||
- | First, check that there is no previous php version installed in the machine, using the command: | ||
- | php –v | + | First, check that there is no previous PHP version installed in the machine, using the command: |
+ | < | ||
- | {{ wiki: | + | php –v |
+ | |||
+ | </ | ||
- | Once verified that php has been uninstalled correctly, download the epel and remi last version repositories to install them: | + | {{ |
+ | Once verified that php has been uninstalled correctly, download the [[https:// | ||
< | < | ||
+ | |||
# yum install https:// | # yum install https:// | ||
# yum install http:// | # yum install http:// | ||
+ | |||
</ | </ | ||
- | For CentOS 6 versions, download them from here: | + | In order to use the **yum-config-manager** command you must have **yum-utils** installed, verify your installation with the following command: |
+ | < | ||
+ | yum install yum-utils | ||
+ | |||
+ | </ | ||
+ | |||
+ | For install PHP 7.2 version: | ||
< | < | ||
- | # | + | yum-config-manager |
- | # yum install http:// | + | |
</ | </ | ||
- | {{ wiki:Epel.png }} | + | For install PHP 7.4 version: |
- | {{ wiki:Remi.png }} | + | |
- | Next, install **yum-utils** in case of not having installed it previously to be able to use the command **yum-config-manager**: | + | < |
+ | yum-config-manager | ||
+ | |||
+ | </ | ||
+ | |||
+ | Finally, install the selected PHP version: | ||
< | < | ||
- | yum install | + | yum install |
- | yum-config-manager | + | |
</ | </ | ||
- | {{ wiki:Yum_manager.png }} | + | {{ :wiki:version_7_2_php.png }} |
- | Finally, install | + | And check the installed |
- | yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-snmp php-mbstring php-pecl-zip php-xmlrpc libxslt php-xml | + | {{ : |
- | {{ wiki:Yum_Install_php.png }} | + | {{ :wiki:version_7_4_php.png }} |
- | And check the installed version | + | ==== PHP 7 Update ==== |
- | {{ wiki: | + | <WRAP center round tip 60%> |
- | === Windows === | + | Run as **root** or use **sudo** for all commands to use. |
- | In the first place, go to the https:// | + | |
- | {{ wiki: | + | </ |
- | Once the zip is downloaded, unzip it in the folder **C:\php**. | + | === CentOS === |
- | When the folder is created, copy the // | + | Check PHP version installed in the machine: |
- | To finish off, change the //httpd-php.conf// file, and change the //LoadFile and LoadModule// | + | < |
+ | php –v | ||
- | {{ wiki: | + | </ |
- | ==== PHP 7 Update ==== | + | {{ |
- | === CentOS === | + | |
- | Download the epel and remi last version repositories to install: | + | |
+ | Download the [[https:// | ||
< | < | ||
+ | |||
# yum install https:// | # yum install https:// | ||
# yum install http:// | # yum install http:// | ||
+ | |||
</ | </ | ||
- | For CentOS 6 versions, download them from here: | + | In order to use the **yum-config-manager** command you must have **yum-utils** installed, verify your installation with the following command: |
+ | < | ||
+ | yum install yum-utils | ||
+ | |||
+ | </ | ||
+ | |||
+ | For install PHP 7.2 version: | ||
< | < | ||
- | # | + | yum-config-manager |
- | # yum install http:// | + | yum-config-manager --enable remi-php72 |
</ | </ | ||
- | {{ wiki:Epel.png }} | + | For install PHP 7.4 version: |
- | {{ wiki:Remi.png }} | + | |
- | Next, install **yum-utils** in case it has not been installed previously in your machine to be able to use the **yum-config-manager** command: | + | < |
+ | yum-config-manager --disable ' | ||
+ | yum-config-manager | ||
+ | |||
+ | </ | ||
+ | |||
+ | Finally, install the selected PHP version: | ||
< | < | ||
- | yum install | + | yum install |
- | yum-config-manager | + | |
</ | </ | ||
- | {{ wiki:Yum_manager.png }} | + | {{ :wiki:version_7_2_php.png }} |
- | Finally, install | + | And check the installed |
- | yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-snmp php-mbstring php-pecl-zip php-xmlrpc libxslt php-xml | + | {{ : |
- | {{ wiki:Yum_Install_php.png }} | + | {{ :wiki:version_7_4_php.png }} |
- | And check the installed version | + | ==== Rocky Linux 8 ==== |
- | {{ wiki: | + | PHP version by default is PHP 7.2, update to PHP 7.4 with: |
+ | < | ||
+ | dnf module reset php -y | ||
+ | dnf module enable php:7.4 | ||
+ | dnf update -y | ||
+ | |||
+ | </ | ||
- | If some version | + | Check new version |
- | If you see any incompatibility notice with the Pandora FMS Console package installed, copy the rpm of version 729 into this directory or execute the following command: | + | {{ |
- | rpm -U --force *.rpm --nodeps | ||
+ | ===== php.ini file ===== | ||
There is also the possibility that during the upgrade process to php7, the php.ini file is affected. Here is an example of some of the data that php.ini must include: | There is also the possibility that during the upgrade process to php7, the php.ini file is affected. Here is an example of some of the data that php.ini must include: | ||
Line 132: | Line 178: | ||
max_execution_time = 0 | max_execution_time = 0 | ||
max_input_time = -1 | max_input_time = -1 | ||
- | memory_limit = 500M | + | memory_limit = 800M |
error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_WARNING | error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_WARNING | ||
log_errors = On | log_errors = On | ||
Line 155: | Line 201: | ||
sendmail_path = / | sendmail_path = / | ||
mail.add_x_header = On | mail.add_x_header = On | ||
- | </ | ||
- | |||
- | |||
- | === Windows === | ||
- | First, go to the website: https:// | ||
- | |||
- | {{ wiki: | ||
- | |||
- | Once the zip is downloaded, unzip it in the folder **C:\php**. | ||
- | |||
- | {{ wiki: | ||
- | Next, go to the folder located in **C: | ||
- | |||
- | {{ wiki: | ||
- | |||
- | When the folder is created, copy the // | ||
- | |||
- | After finishing this step, copy the // | ||
- | |||
- | The installation of **Microsoft Visual C++ 2015**: https:// | ||
- | |||
- | To finish off, change the // | ||
- | |||
- | |||
- | {{ wiki: | ||
- | |||
- | === 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: | ||
- | |||
- | Once this step is done, update to install it: | ||
- | |||
- | sudo apt-get update | ||
- | |||
- | To make sure that all apache packages have been installed correctly, and to check that apache will be able to run with the new version, run the following command too: | ||
- | |||
- | sudo apt-get install php7.2 | ||
- | |||
- | And do the same for the dependencies left: | ||
- | |||
- | sudo apt-get install php7.2-mysql php7.2-cli php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-ldap php7.2-mbstring php7.2-opcache php7.2-readline php7.2-snmp php7.2-xml php7.2-xmlrpc php7.2-zip | ||
- | |||
- | In case both php versions are kept, the old php version must be disabled so that the new php7 version can be enabled. Later restart apache service. | ||
- | |||
- | a2dismod php5.6 | ||
- | |||
- | a2enmod php7.0 | ||
- | |||
- | service apache2 restart | ||
- | |||
- | === Suse === | ||
- | <WRAP center round important 60%> | ||
- | With older Suse or Opensuse versions, php7 packages may not be available. | ||
- | </ | ||
- | |||
- | To install php7 and its extensions, use the following command: | ||
- | |||
- | sudo zypper install php7 php7-mysql apache2-mod_php7 | ||
- | |||
- | Once installed, activate the php7 module and restart the Apache server: | ||
- | |||
- | < | ||
- | sudo a2enmod php7 | ||
- | sudo systemctl restart apache2 | ||
</ | </ | ||
- | === Offline actualization in CentOS === | + | [[:en: |
- | In case the environment installed with Pandora FMS ISO does not have internet access or the security policy does not allow to install a third party repository, we have provided all the rpms needed for php update in our official support website (only for Enterprise clients) together with 729 version packages. | + | |
- | + | ||
- | The procedure for this update is as follows: | + | |
- | + | ||
- | 1.- Download the tar.gz with the RPMs of our support web ( there are rpms compatible with Centos 6 x86, Centos 6 x64 and Centos 7 x64 ) | + | |
- | + | ||
- | 2.- Decompress the content of tar.gz in any directory. | + | |
- | + | ||
- | tar xvzf rpm-php7-centos7.tar.gz | + | |
- | + | ||
- | 3.- Access the uncompressed directory with the cd command and execute the following command | + | |
- | + | ||
- | < | + | |
- | cd rpm-centos7-php7 | + | |
- | rpm -U --force *.rpm | + | |
- | </ | + | |
- | + | ||
- | In case you see any incompatibility notice with the Pandora FMS Console package installed, copy the rpm of version 729 into this directory or execute the following command. | + | |
- | + | ||
- | rpm -U --force *.rpm --nodeps | + | |
- | [[en: | ||