INCLUDE './config/databases.php';
require './vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
当我从浏览器执行此脚本时,我没有收到任何警告/问题。 但是当我为Cron工作添加相同的脚本时
Warning: include(./config/databases.php): failed to open stream: No such file or directory in /home/webdir/public_html/corn_mail.php on line 2
Warning: include(): Failed opening './config/databases.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/webdir/public_html/corn_mail.php on line 2
Warning: require(./vendor/phpmailer/phpmailer/PHPMailerAutoload.php): failed to open stream: No such file or directory in /home/webdir/public_html/corn_mail.php on line 3
Fatal error: require(): Failed opening required './vendor/phpmailer/phpmailer/PHPMailerAutoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/webdir/public_html/corn_mail.php on line 3
也尝试从./config/databases.php
更改为/home/webdir/public_html/config/databases.php
仍然相同。
有什么建议吗?
答案 0 :(得分:0)
尝试删除./
- config/databases.php
,如果vendor
位于同一文件夹中,则vendor/phpmailer/phpmailer/PHPMailerAutoload.php
。无需./
。