我在使用phar文件的弹性beanstalk应用程序中为PHP安装了aws sdk:
require_once __DIR__ . '/../AWS-SDK/aws.phar';
当我第一次运行脚本时,它成功了!但是当我再试一次时,我收到了这个错误:
Warning: require(phar://aws.phar/aws-autoloader.PHP): Failed to open stream: phar error: invalid url or non-existent phar "phar://aws.phar/aws-autoloader.PHP" in /var/app/current/src/utils/AWS-SDK/aws.phar on line 3 Fatal error: require(): Failed opening required 'phar://aws.phar/aws-autoloader.PHP' (include_path='.:/usr/share/pear:/usr/share/PHP') in /var/app/current/src/utils/AWS-SDK/aws.phar on line 3
如何解决问题?
不要使用require_once.这导致了这个问题.您应该使用require或include
原文链接:https://www.f2er.com/php/137070.html