PHP 8 doesn't load mibs from /usr/share/snmp/mibs on RHEL 9.5

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rex Maughan
    Senior Member
    • Mar 2022
    • 221

    PHP 8 doesn't load mibs from /usr/share/snmp/mibs on RHEL 9.5

    Hi,
    For whatever reason PHP 8 isn't automatically looking in /usr/share/snmp/mibs for the MIB files like PHP 7.2 did.

    PHP Warning: snmprealwalk(): Invalid object identifier: ipRouteMask

    Any solutions for this?
  • wisly.k
    Senior Member
    • May 2022
    • 195

    #2
    Hey, by default, Net-SNMP does not load MIBs unless explicitly configured. Enabling MIB Loading in the Net-SNMP Configuration may Help:

    To enable automatic MIB loading:

    --> Edit (or create) the SNMP configuration file:

    sudo nano /etc/snmp/snmp.conf

    Add the following line:

    mibs +ALL
    • Save and exit.

    Restart PHP or your web server:

    sudo systemctl restart php-fpm

    sudo systemctl restart httpd # If using Apache

    sudo systemctl restart nginx # If using Nginx​

    Comment

    • Clay Page
      Senior Member
      • Sep 2022
      • 127

      #3
      Hi, You can try this: may help.

      Set Environment Variable (for CLI PHP)


      If you're using PHP CLI or scripts run via cron, set this environment variable before running your script:

      export MIBS=+ALL

      You can place this in /etc/profile.d/snmp.sh or within your PHP script using:

      -> php

      putenv('MIBS=+ALL');

      Comment

      VPS Hosting
      Working...
      X