Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

robertosantana's avatar

Error deploying to Google Cloud App Engine

Hello, I'm deploying a new app to Google Cloud App Engine, everything is running fine but I get a 500 error on the site and this message on the logs:

2021/11/19 09:45:50 [error] 23#23: *10 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ReflectionException: Class translator does not exist in /workspace/vendor/laravel/framework/src/Illuminate/Container/Container.php:877  Stack trace:  #0 /workspace/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct('translator')  #1 /workspace/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build('translator')  #2 /workspace/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve('translator', Array, true)  #3 /workspace/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Application->resolve('translator', Array)  #4 /workspace/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(826): Illuminate\Container\Container->make('translator', Array)  #5 /workspace/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(119): Illuminate\Foundation\Application->make...PHP message: PHP Fatal error:  Uncaught ReflectionException: Class translator does not exist in /workspace/vendor/laravel/framework/src/Illuminate/Container/Container.php:877

Any ideas of what could be happening here? Thanks!

0 likes
9 replies
mk001's avatar

Hi @robertosantana, might I ask which docs you follow to deploy the app since the official one in the GAE page is quite outdated now. Thanks so much

robertosantana's avatar

@mk001 Thanks for your reply, I've read the new guide but I still get this error:


2021-11-22 12:27:39 default[20211119t170958]  2021/11/22 12:27:39 [error] 23#23: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ErrorException: file_put_contents(/workspace/storage/framework/views/c1b305dfa33e081e1fc836f46439e09f829e8770.php): failed to open stream: Read-only file system in /workspace/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:187  Stack trace:  #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/workspace/vend...', 187, Array)  #1 /workspace/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(187): file_put_contents('/workspace/stor...', '<?php $__env->s...', 0)  #2 /workspace/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(164): Illuminate\Filesystem\Filesystem->put('/workspace/stor...', '<?php $__env->s...')  #3 /workspace/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(55): Illuminate\View\Compilers\BladeCompiler->compile('/workspace/vend...')  #4 /workspace/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\View...PHP message: PHP Fatal error:  Uncaught ErrorException: file_put_contents(/workspace/storage/framework/views/c1b305dfa33e081e1fc836f46439e09f829e8770.php): failed to open stream: Read-only file system in /workspace/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:187

Do you know how to solve it?

Thanks again

saxomoose's avatar

@robertosantana I am busy with a GAE deployment (standard environment) and I am running into the exact same exception thrown by /workspace/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): Uncaught ReflectionException: Class translator does not exist.

Did you manage to solve this problem?

Thanks for any tips.

saxomoose's avatar

OK so I resolved my problem by following this updated guide: <github.com>/no-simpler/gcp-community/blob/update-gae-std-laravel/tutorials/run-laravel-on-appengine-standard/index.md

I departed from the guide on two points:

  • I added DB_CONNECTION=mysql to the .env.gae file.
  • I removed && rm -f .env from the composer.json file.

I will communicate these comments on github to the author of the guide.

1 like

Please or to participate in this conversation.