Cannot find module (SNMPv2-TC) Cannot find module (SNMPv2-TC)

When I run PHP via the command line (aka php cli), I often would be spammed with the following error messages:

Cannot find module (SNMPv2-TC)

Cannot find module (SNMPv2-SMI)

Messages like this would repeat for 30 or 40 lines. These errors would not stop my command from executing; however, it was extremely noisy when trying to see the output.


How to fix Cannot find module (SNMPv2-TC) and (SNMPv2-SMI)

Some command examples I would run would be:

php myfile.php

Or when I would run CakePHP console commands:

/mycakephpapp/app/Console/cake mycakephpcommand

To resolve this problem I simply removed the following package: php5-snmp using the following command:

sudo apt-get remove php5-snmp

The above snippet is for php5, if you are using php7, it would be:

sudo apt-get remove php7.0-snmp

Be careful before removing packages to ensure your application doesn't use them. In my case I was not using this package and removing it reduced all of the errors when running PHP via the command line.

Published on Feb 18, 2019

Tags: CakePHP Tutorial | PHP

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.

Tutorials

Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.