Laravel Forge / Envoyer使用旧版本,因为升级到5.5

时间:2018-01-31 07:26:34

标签: laravel laravel-5.5

自从升级到Laravel 5.5后,我遇到了非常奇怪的行为,在Envoyer成功部署后,该网站将继续显示旧版本。

current文件夹已正确设置为最新版本,但该网站仍显示旧版本。

如果手动删除旧版本文件夹,或者通过部署足够的时间删除旧版本文件夹,整个网站将会中断,并显示:

Warning: include(/home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/../vlucas/phpdotenv/src/Exception/InvalidPathException.php): failed to open stream: No such file or directory in /home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/ClassLoader.php on line 444

Warning: include(): Failed opening '/home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/../vlucas/phpdotenv/src/Exception/InvalidPathException.php' for inclusion (include_path='.:/usr/share/php') in /home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/ClassLoader.php on line 444

Warning: include(/home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/../symfony/debug/Exception/FatalThrowableError.php): failed to open stream: No such file or directory in /home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/ClassLoader.php on line 444

Warning: include(): Failed opening '/home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/../symfony/debug/Exception/FatalThrowableError.php' for inclusion (include_path='.:/usr/share/php') in /home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/composer/ClassLoader.php on line 444

Fatal error: Uncaught Error: Class 'Symfony\Component\Debug\Exception\FatalThrowableError' not found in /home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:122 Stack trace: #0 /home/forge/sitefoo.com/envoyer/releases/20180130124512/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #1 {main} thrown in /home/forge/sitefoo.com/envoyer/releases/20180130124512/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php on line 122

删除旧文件夹后重启服务器后,一切都会恢复正常,并会使用正确的版本。

有没有人对什么出错或如何解决这个问题有任何想法?

由于

2 个答案:

答案 0 :(得分:0)

从我所读过的内容来看,这似乎与队列侦听器有关,特别是当它没有作为守护程序运行时。修复程序似乎是在Forge中将队列处理器设置为守护程序。

此外,在队列重新启动之前,更改工作人员配方以清除缓存:

// change php version to yours
sudo service php7.1-fpm reload
// clear cache
php artisan queue:restart

答案 1 :(得分:0)

此问题的解决方案是更新Envoyer中服务器的PHP版本。

更新到Laravel 5.5后,服务器也更新为PHP 7.2。这从未在Envoyer服务器的设置中设置,因此可能导致问题,可能使用旧的PHP-FPM版本。