Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
No log handling enabled - turning on stderr logging Cannot find

I'm trying to setup a Cron Job that runs a .php file that will automate client email correspondence. I've created the .php file and the Cron Job through cPanel. Everything works fine in that I'm getting my test email as I require it when I require it, but I'm also getting an additional server email on every send with the following content:

No log handling enabled - turning on stderr logging Cannot find module (MTA-MIB): At line 1 in (none) Cannot find module (NETWORK-SERVICES-MIB): At line 1 in (none)

The Cron Job is as follows:

0.3 * * * * php -q /home/USERNAME/public_html/cron/test.php

I've done research on this site and couldn't find a solution. I've also chatted with my hosting company and believe it or not his best advice was to refer me to this site.

share|improve this question

migrated from Aug 11 '11 at 8:29

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Chris S Feb 20 '12 at 20:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.… No closing answer there though... – Pelshoff Aug 11 '11 at 6:29
Pelshoff - Thanks for the snappy reply. I did go through that post yesterday and can't find an answer though. I'll keep an eye on that one. – Deano Aug 11 '11 at 7:02
Dan - Also thanks for the quick reply. I'll take a look at serverfault and see what I can find. – Deano Aug 11 '11 at 7:03

Based on this post it looks like you have snmp enabled in your php install, but you don't have the underlying snmp software. If you install the net-snmp package on the machine that should fix the problem.

Alternately, you could edit your php.ini file and remove the snmp modules, as you probably aren't using them anyway.

If however you can do neither of those things (because you don't control the server) then you might have to just live with the error emails. You can always just redirect them the the bitbucket.

However, I would hope that if you point this problem out to your hosting provider, they would be willing to at least fix the php.ini on the system to not load the snmp modules.

share|improve this answer

Try log output to a file using echo in your code. It might work.

0.3 * * * * php -q /home/USERNAME/public_html/cron/test.php >> /home/USERNAME/log/email.log
share|improve this answer
Hi Regnar, Thanks for your quick reply. I've done as suggested and the log file remains empty. If I echo some test text in the script file this is then written to the log file but still no solution as to why I'm getting this error email – Deano Aug 11 '11 at 7:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.