【发布时间】:2021-03-22 15:45:15
【问题描述】:
我正在尝试在 plesk 中使用 smtp 发送电子邮件,但它一直给我以下错误,即使在搜索相关解决方案后我也无法解决此问题:
AH01071: Got error 'PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/vhosts/xxxx.com/public/../../storage/framework/maintenance.php) is not within the allowed path(s): (/var/www/vhosts/xxxx.com/:/tmp/) in /var/www/vhosts/xxxx.com/public/index.php on line 19', referer: https://xxxx.com/email/verify
我在 public/index.php 中有这个
if (file_exists(__DIR__.'/../../storage/framework/maintenance.php')) {
require __DIR__.'/../../storage/framework/maintenance.php';
}
这是我默认的 open_basedir 路径:
{WEBSPACEROOT}{/}{:}{TMP}{/}
这是我在 .env 文件中的配置:
MAIL_MAILER=smtp
MAIL_HOST=xxx.com
MAIL_PORT=465
MAIL_USERNAME=xxxx.com
MAIL_PASSWORD=xxxx
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS='noreply@xxxx.com'
MAIL_FROM_NAME="${APP_NAME}"
如果有人可以帮助我,我将非常感激
【问题讨论】: