我有一个现有的Laravel 8应用程序,部署在Google云应用程序引擎中。
我想升级到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提前谢谢。
发布于 2022-07-23 11:42:01
尝试将运行时设置为php80:https://github.com/symfony/symfony/issues/42231
发布于 2022-08-04 06:19:33
https://stackoverflow.com/questions/73088972
复制相似问题