Ad Widget

Collapse

PHP problem on Raspberry Pi

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Timk
    Junior Member
    • Jul 2020
    • 3

    #1

    PHP problem on Raspberry Pi

    I am attempting to install Zabbix 5.0 on a Raspberry Pi 3B+ running Raspbian 9.11 (stretch) using the directions here: https://www.zabbix.com/download?zabb...ysql&ws=apache

    After installing, and trying to connect to the front end I receive the following error:

    Minimum required PHP version is 7.2.0.

    I initially checked my PHP version which was 7.0, I upgraded it to 7.2.0 and received the same error again.

    I then upgraded to PHP 7.4.8 and still receive the same error.

    php -v returns

    PHP 7.4.8 (cli) (built: Jul 13 2020 16:37:16) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies

    I then uninstalled Zabbix, removed the database and started over.

    I still receive the same error. I found this post: https://www.zabbix.com/forum/zabbix-...nd-php-problem and followed the instructions here: https://www.zabbix.com/forum/zabbix-...ion#post294266.

    I did make sure libapache2-mod-php was installed and apt list --installed | grep php results in:

    libapache2-mod-php/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed]
    libapache2-mod-php7.0/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    libapache2-mod-php7.2/unknown,now 7.2.32-1+0~20200710.46+debian9~1.gbp625eb5 armhf [installed,automatic]
    libapache2-mod-php7.4/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed]
    php-bcmath/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-bz2/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-common/unknown,now 2:76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-curl/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-gd/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-ldap/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-mbstring/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-mysql/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed]
    php-pear/unknown,now 1:1.10.9+submodules+notgz-1+0~20191119.13+debian9~1.gbp296d25 all [installed,automatic]
    php-php-gettext/oldstable,now 1.0.12-0.1 all [installed,automatic]
    php-phpseclib/oldstable,now 2.0.4-1 all [installed,automatic]
    php-tcpdf/oldstable,now 6.2.12+dfsg2-1 all [installed,automatic]
    php-xml/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php-zip/unknown,now 2:7.4+76+0~20200511.26+debian9~1.gbpc9beb6 all [installed,automatic]
    php7.0/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f all [installed,automatic]
    php7.0-bz2/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-cli/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-common/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-curl/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-gd/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-json/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-mbstring/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-opcache/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-readline/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-xml/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.0-zip/unknown,now 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f armhf [installed,automatic]
    php7.2/unknown,now 7.2.32-1+0~20200710.46+debian9~1.gbp625eb5 all [installed]
    php7.2-cli/unknown,now 7.2.32-1+0~20200710.46+debian9~1.gbp625eb5 armhf [installed,automatic]
    php7.2-common/unknown,now 7.2.32-1+0~20200710.46+debian9~1.gbp625eb5 armhf [installed,automatic]
    php7.2-json/unknown,now 7.2.32-1+0~20200710.46+debian9~1.gbp625eb5 armhf [installed,automatic]
    php7.2-opcache/unknown,now 7.2.32-1+0~20200710.46+debian9~1.gbp625eb5 armhf [installed,automatic]
    php7.2-readline/unknown,now 7.2.32-1+0~20200710.46+debian9~1.gbp625eb5 armhf [installed,automatic]
    php7.4/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c all [installed]
    php7.4-bcmath/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php7.4-bz2/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php7.4-cli/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed]
    php7.4-common/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed]
    php7.4-curl/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed]
    php7.4-gd/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php7.4-json/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php7.4-ldap/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php7.4-mbstring/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed]
    php7.4-mysql/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed]
    php7.4-opcache/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php7.4-readline/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    php7.4-xml/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed]
    php7.4-zip/unknown,now 7.4.8-1+0~20200713.23+debian9~1.gbpb2c15c armhf [installed,automatic]
    phpmyadmin/oldstable,now 4:4.6.6-4+deb9u1 all [installed]
    zabbix-frontend-php/oldstable,now 1:3.0.7+dfsg-3 all [installed]

    So, what am I missing here?
  • Sebastian
    Member
    • Jul 2020
    • 33

    #2
    Hello TimK,


    you have installed php, but now have to make web browser use it.

    it would be good idea to check if apache is using php => 7.2
    you can do this with phpinfo.php file, - search how to do this in google for first site with keyword "how-to-check-the-php-version-on-linux"



    Please also consider that zabbix might generate much iops and can kill your Rpi SD card very soon.

    Comment

    • Timk
      Junior Member
      • Jul 2020
      • 3

      #3
      Sebastian,

      Thanks for pointing me in the right direction. After a little google-fu I was able to fix the problem.

      Also, thanks for reminding me about the iops. Yes, it may be an issue with the SD card. I may configure the rasp pi to boot off of a spare hard drive instead.

      This is mostly a test system for me to monitor a few devices on my home network as a proof of concept. I may end up installing it on an old laptop running Linux if I want to do more. But in the meantime, I'll make a backup of the SD card just in case.
      Last edited by Timk; 24-07-2020, 17:28.

      Comment

      • Timk
        Junior Member
        • Jul 2020
        • 3

        #4
        Here is what I did (just in case anyone else has the same problem).

        I created a phpinfo.php file in /var/www/html that was simply:
        <?php
        phpinfo();
        ?>


        In my web browser, I navigated to http://<ip_address>/phpinfo.php

        This showed that Apache was indeed using PHP 7.0 although running php -v in the CLI still reported 7.4.8

        I ran:
        sudo a2dismod php7.0
        sudo service apache2 restart


        This time when I refreshed the web browser, I was just presented with the contents of the phpinfo.php file, meaning that Apache was not using php at all.

        I then ran:
        sudo a2enmod php7.4
        sudo service apache2 restart


        This time after refreshing the browser, Apache was correctly using php 7.4.8

        I then navigated to http://<ip_address>/zabbix which now correctly presents me with the Zabbix welcome page.




        Comment

        Working...