通过pear安装邮件后,Require_once停止工作[复制]

问题描述 投票:0回答:2

这个问题在这里已有答案:

所以在我的Ubuntu 16.04服务器上,我的/ var / www / html /目录中有几个.php文件,我会做常规的PHP内容,如数据检索,用户登录等等。我想实现邮件验证我希望使用gmail smtp服务的服务,所以我通过以下命令通过pear安装邮件:

pear install --alldeps Mail

按照this website中的步骤后,我重新启动了apache2,现在我的php require_once无效。我试过include_path也没用。

我卸载了pear uninstall mail的邮件,删除了php并重新安装它希望它能恢复文件,但没有运气,有谁知道发生了什么,我该如何解决?

示例代码:require_once 'DbOperation.php';

上面的代码工作,我希望它工作,因为它是我的整个php api的关键,请不要建议一个解决方法。任何帮助表示赞赏。

php email apache2 pear require-once
2个回答
0
投票

你尝试过的任何东西都不会导致requirerequire_once突然停止工作。确保已启用所有错误报告:

ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(E_ALL);

启用错误报告后,您可能会发现其他问题(例如需要的代码)。


0
投票

戴夫的回答通过检查require_once('filename')中的文件名解决了我的问题,这个文件夹丢失了“)”...菜鸟错误,我知道。

ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

把它放在你的php文件中显示错误,找出你的问题是什么。谢谢戴夫!

© www.soinside.com 2019 - 2024. All rights reserved.