Dear all,
Here is the code:
#!/usr/bin/php -q
<?php
echo "\n Today is " . date("D M j G:i:s T Y") ."\n\n";
if (!extension_loaded("imap")) {
echo "\n ERROR: imap extension is NOT loaded\n\n\n\n";
} else {
echo "\n and imap is OKAY\n\n\n\n";
}
?>
So the problem is when I execute it from browser, the imap extension is recognized and I can use imap functions without any problems, i.e. the example above produces the following output:
#!/usr/bin/php -q Today is Sat Feb 1 22:34:20 EST 2003 and imap is OKAY
BUT (!!!) when I try to execute it from shell, I see
Today is Sat Feb 1 22:39:25 EST 2003
ERROR: imap extension is NOT loaded
Same code, same machine, same directory. What's wrong? Thanks in advance for any help...
PS I tried to explicitly use the location of php.ini directory, i.e.
php -c /usr/local/Zend/etc/php.ini cli_test.php
OR
php -c /usr/local/Zend/etc cli_test.php
but it didn't help 🙁 Any ideas?