I've been struggling with the Google App Engine Standard environment for a day now.
The error is as follows:
PHP Notice: Exception: The /srv/bootstrap/cache directory must be present and writable. in /srv/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php:168
I know that the /tmp
folder is the only writable folder for the App Engine Standard environment. Therefore, my app.yaml
have the following additional env_variables
:
APP_STORAGE: "/tmp"
VIEW_COMPILED_PATH: "/tmp"
...my bootstrap/app.php
contains this line:
$app->useStoragePath(env('APP_STORAGE', base_path() . '/tmp'));
...and my composer.json
has these scripts to account for the change in configuration:
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump"
],
"post-install-cmd": [
"composer dump-autoload",
"php artisan config:clear",
"php artisan cache:clear",
"php artisan view:clear",
"php artisan cache:clear",
"php artisan regenerate:schoolCSS"
]
These are my drivers configured in app.yaml
:
SESSION_DRIVER: database
BROADCAST_DRIVER: log
CACHE_DRIVER: database
QUEUE_DRIVER: sync
For some reason, I just can't seem to find a way to make the /tmp
folder the folder where the cached views and config are put. Actually, I suspect that the ...:clear
commands aren't even properly ran at all.
My application is just a blank white page now, regardless of the path. That's fair, as due to the unwritable cache, the views cannot be rendered and stored there.
The above configurations should match the tutorials for installing Laraval on Google App Engine Standard, such as this one: https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard.
In the cloud console, I've checked whether the /tmp
folder exists, which is the case.
Anyways, all help is dearly appreciated. If you need more code snippets, just ask. I'll be happy to provide them.
/srv/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php
file and dump$this->manifestPath
property in write method? – Wolfenbarger