首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在部署过程中Laravel 9升级问题

在部署过程中Laravel 9升级问题
EN

Stack Overflow用户
提问于 2022-07-23 07:51:09
回答 2查看 536关注 0票数 0

我有一个现有的Laravel 8应用程序,部署在Google云应用程序引擎中。

我想升级到Laravel 9,但是在部署的时候遇到了一个奇怪的问题-

代码语言:javascript
复制
Updating service [default]...failed.                                                                                                                                                                                                   
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 92fff745-cde1-47d0-b66f-5ec5ac4fc026 status: FAILURE
...n Notice: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php:42
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:55
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:71
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php:76
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/symfony/finder/Iterator/FilterIterator.php:30
Deprecation Notice: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///layers/google.php.composer-install/composer/bin/composer/vendor/symfony/finder/Iterator/PathFilterIterator.php:27
Class App\Http\Controllers\api\AllApiController located in ./app/Http/Controllers/Api/AllApiController.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
54 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> chmod -R 755 bootstrap/cache
> php artisan config:clear

In Compiler.php line 66:
                                      
  Please provide a valid cache path.  
                                      

Script php artisan config:clear handling the post-install-cmd event returned with error code 1

此错误发生在试图清除路由、缓存或配置时。这是composer.json中触发错误的相关部分-

代码语言:javascript
复制
"scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],     
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-install-cmd": [
            "chmod -R 755 bootstrap\/cache",
            "php artisan config:clear"
            "php artisan route:clear",
            "php artisan cache:clear"
        ]
    }

我已经尝试谷歌,但还没有找到任何相关的答案。我不太清楚是什么导致了这一问题,并用尽了我所能想到的所有途径。如果能在这方面提供任何帮助,我们将不胜感激。

我正在升级从Laravel 8.09.11,从PHP 7.2升级到8.0.2

在我的app.yaml中,应用程序引擎的运行时设置为php81

由于storage目录结构,一些用户也有类似的错误。存储中有以下目录结构,但我认为错误与此无关。我的目录结构根本没有改变,唯一的变化就是Laravel和PHP的升级。

代码语言:javascript
复制
storage
 - framework
   - cache
      - data
   - sessions
   - views

提前谢谢。

EN

回答 2

Stack Overflow用户

发布于 2022-07-23 11:42:01

尝试将运行时设置为php80https://github.com/symfony/symfony/issues/42231

票数 0
EN

Stack Overflow用户

发布于 2022-08-04 06:19:33

一旦安装了新的PHP版本,您是否运行了composer全局更新,从而升级了全局编写器依赖项?

您可以尝试运行composer自更新,然后尝试运行全局更新。

您还可以参考这个GitHub链路

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73088972

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档