[SOLVED] Running PHP CLI - Cannot find module

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

[SOLVED] Running PHP CLI - Cannot find module

Post by anjanesh »

One line code :

Code: Select all

<?php
echo "Hello";
?>
Tried running this on my WinXP PC - Apache 2.0.52 + PHP 5.1.1

Code: Select all

C:\php>php C:\xxx\xxx\cli.php
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
Hello 
C:\php>
Working but giving this long list of Cannot find module but the same doesnt occur on my hosting linux server when I ran it through Putty.

Any idea how to get rid of these warnings ? Or not load these modules by default.

Thanks
Last edited by anjanesh on Mon Jan 09, 2006 11:28 am, edited 1 time in total.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

comment out this line in php.ini:

Code: Select all

.......
extension=php_snmp.dll
.......
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Hmmm...thats strange - no startup errors show up when Apache is started.

In my php.ini :
display_startup_errors = On
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Probably the php-cli is using a different php.ini file...
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Delete all extra php.ini files (check Windows, Windows\system32, etc - or run a search like a sane person ;)) - place one copy in the same directory as the cli executable (should look for it there first by default). If php.exe is in a separate directory, put an exact duplicate there - seems to work for me at least.

Check extensions dir is set in the ini correctly. And enable each extension one at a time until you hot any other errors, or reach the extensions loaded you require. I noticed before loading oci extensions for oracle is a pain - never seems to find them on XP for some reason - even if the path to \extensions\ is perfect. Might be the same for one of the above or more.

Maybe try the windows PHP installer? I never have myself, but surely it was tested for all this...
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Theres no other php.ini file.

Code: Select all

C:\>dir php.ini /s
 Volume in drive C has no label.
 Volume Serial Number is xxxx-xxxx

 Directory of C:\WINDOWS

01/06/2006  10:40 PM            42,300 php.ini
               1 File(s)         42,300 bytes

     Total Files Listed:
               1 File(s)         42,300 bytes
               0 Dir(s)  13,060,427,776 bytes free

C:\>
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Not a clue in that case - I have 5.1 on an XP at home so I'll try its cli executable and see the results later. Can't imagine what else can be causing the errors...
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Weirdan wrote:comment out this line in php.ini:

Code: Select all

.......
extension=php_snmp.dll
.......
Ok - now no errors !
Still Strange though - no startup errors - checked apache logs.

Thanks
Post Reply