【发布时间】:2022-08-04 14:19:33
【问题描述】:
我有一个部署在 Google Cloud App Engine 中的现有 Laravel 8 应用程序。
我正在尝试升级到 Laravel 9,但是在尝试部署时遇到了一个奇怪的问题-
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 中触发错误的相关部分 -
\"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.0 升级到 9.11 和 PHP 7.2 到 8.0.2。
在我的app.yaml 中,应用引擎的运行时间设置为php81。
由于storage 目录结构,一些用户遇到了类似的错误。我在存储下有以下目录结构,但是我认为该错误与此无关。我的目录结构完全没有变化,唯一的变化是 Laravel 和 PHP 的升级。
storage
- framework
- cache
- data
- sessions
- views
提前致谢。
-
您可以尝试运行
composer self-update,然后尝试运行composer global update。
标签: php google-app-engine laravel-9 php-8.1