首页 > 解决方案 > 为什么我必须为 phpmailer 使用 include_path 目录?

问题描述

我正在学习 PHP。尝试使用 phpmailer 并成功。但是要导入类,只需将文件夹放入项目文件夹中即可。为什么在文档自述文件中说我应该使用include_path目录来使用 phpmailer。

是为了安全吗?

我正在使用 xammp 来学习,但是如果我在生产中使用 phpmailer,它应该始终在 include_path 中吗?

默认是 pear 文件夹,我可以为 phpmailer 创建另一个文件夹,然后将其添加到 php.ini 还是应该使用它(pear)来确保安全或类似的东西?

phpmailer 的自述文件:

Alternatively, if you're not using Composer, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:

我不使用作曲家

标签: php

解决方案


推荐阅读