IMAP "undefined function"
Posted by: theSWiT (---.dsl.sfldmi.sbcglobal.net)
Date: April 26, 2007 05:22PM

I needed to schedule a php script to check a pop3 email account and then process xml in the body of the new email.
using the windows scheduler I scheduled "php.exe thescript.php"

the calls to any of the imap functions gave an error "undefined function".

I used the wamp menu to edit the php.ini. I enabled the php_imap.dll ,
I still got errors.

I looked at the phpinfo() and IMAP was enabled!

after a lot of frustration a co-worker asked if I also editted the "other" php.ini in the wamp\php\ folder.

I editted that wamp\php\php.ini , uncommented the php_imap.dll and it works from the command line now.

The the lesson is that the PHP configuration is different for the command prompt than through Apache with WAMP.

Had I known that yesterday it would have saved me a lot of time.

Options: ReplyQuote
Re: IMAP "undefined function"
Posted by: CyberSpatium (71.237.217.---)
Date: April 27, 2007 01:38AM

that is not true. there is only one php.ini file php uses. use phpinfo() or your wamp tray icon menu to make sure you edit the correct file.


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!

Please visit my latest website Clarify Loans:
clarifyloans.com

Options: ReplyQuote
Re: IMAP
Posted by: theSWiT (---.dsl.sfldmi.sbcglobal.net)
Date: April 27, 2007 10:47PM

Yes it is true.... from the command line.
the php.exe will grab and process the php.ini file in the \wamp\php directory

the php.ini file that gets edited by the wamp tray icon menu exists in \wamp\Apaches2\bin

Again this is in regards to the PHP CLI (command line interface) not PHP running through Apache.

Since WAMP does such a great job managing the configs for Apache it's easy to overlook the php.ini that is used on the command line, as in a PHP script being run by Windows Scheduler .



Post Edited (05-01-07 17:07)

Options: ReplyQuote


Sorry, only registered users may post in this forum.