启用了IMAP,但功能未定义? [英] IMAP enabled, but functions undefined?

查看:94
本文介绍了启用了IMAP,但功能未定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的电子邮件解析脚本之一在使用imap函数时遇到问题:

One of our email parsing scripts is having a problem using imap functions:

严重错误:调用未定义 函数imap_open()

Fatal error: Call to undefined function imap_open()

IMAP绝对是启用的,它是用php编译的,并显示在phpinfo()中,当执行get_loaded_extensions()extension_loaded("imap")时,是否有任何原因可能无法访问这些功能?

IMAP is definitely enabled, it was compiled with php and shows up in the phpinfo() and when doing get_loaded_extensions() or extension_loaded("imap") Is there any reason why these functions may not be accessible?

IMAP版本为2007e,PHP为5.3.

IMAP version is 2007e and PHP is 5.3.

此文件正在Mac服务器(OSX 10.5.7)上运行,使用imap函数的脚本位于/var/***/中,我尝试将测试文件放入/Library/WebServer/Document(网络root),使用完全相同的详细信息使用imap_open,它似乎可以正常工作.

Edit 1: This is running on a mac server (OSX 10.5.7) the script using the imap function is in /var/***/ I tried putting a test file in /Library/WebServer/Document (the web root) using imap_open with the exact same details and it seems to work.

在PHP更新之前,它的设置方式有效-是否有任何理由使其停止工作?我知道我可以将电子邮件脚本移动到Web服务器文档目录中,但是我也想知道为什么它会像以前那样停止工作-可能是php配置的方式吗?

The way it is setup worked before a PHP update - is there any reason for it to stop working? I know I could move the email script into the webserver documents dir but I would also like to know why it would stop working the way it was before - could it be the way php is configured?

推荐答案

使用

echo get_cfg_var('cfg_file_path');

您可以找到此php实例使用了哪个php.ini.您可能会看到php apache-module(或者是php-cgi?)和php cli版本(由您的cronjob使用)正在使用不同的.ini文件.
根据您安装php的方式(以及该版本的php的编译方式),apache模块可能还会解析cli版本未提供的其他.ini文件.要检查是否是这种情况,请运行

you can find out which php.ini has been used by this instance of php. You will probably see that the php apache-module (or is it php-cgi?) and the php cli version (used by your cronjob) are using different .ini files.
Depending on how you've installed php (and how this version of php was compiled) the apache module might also parse additional .ini files that your cli version does not. To check if this is the case run

<?php phpinfo(); ?>

在您的网络服务器中,然后找到已解析的其他.ini文件"条目.
无论如何,您都必须注意cli版本使用的配置包含extension = php_imap ...指令.

in your webserver and look for an entry "additional .ini files parsed".
In any case you have to take care that the configuration used by the cli version includes the extension=php_imap... directive.

这篇关于启用了IMAP,但功能未定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆