1

I've been able to get Craft to run on Google App Engine (GAE), but not Cloud Run as of yet.

The error message I'm seeing in the browser is:

/app/craftcms/storage/runtime isn't writable by PHP. Please fix that.

I encountered this error when deploying to GAE and the solution was to have the Dockerfile run a shell script that chmod 755 -R ./storage. This approach does not work for Cloud Run as I still see the same message in the browser despite running the same script.

I know that Cloud Run is stateless, but we don't need to run admin functions while it's deployed to Cloud Run, so I can't see this being an issue. Has anyone else successfully deployed to Cloud Run?

6
  • Hi @Eric! May I ask how you managed to run Craft CMS on GCP App Engine Standard? As far as I understand you only have write access to /tmp on App Engine Standard, so I tried to set the following variable in bootstrap.php: define('CRAFT_STORAGE_PATH', '/tmp'); But I still get an error on GCP: mkdir(): Read-only file system in /workspace/vendor/yiisoft/yii2/helpers/BaseFileHelper.php on line 711 Cheers Michael Commented Jan 26 at 10:22
  • 1
    @MichaelHunziker we used Memorystory's Memcached for temporary files, Google Cloud Storage for image transformation variants via the GCS plugin, and disable logging to a file in production (obviously) and route through stdout.
    – Eric
    Commented Jan 29 at 22:13
  • 1
    Thanks a lot @Eric! Commented Jan 31 at 14:20
  • If you don't mind me asking: So you use Memcached for tmp files, for example the cpresources, right? How have you been able to "serve" these cpresources? Do you have a special handler defined in your GCP app.yaml for this? Commented Jan 31 at 14:49
  • 1
    Sure thing @MichaelHunziker - happy to help
    – Eric
    Commented Feb 2 at 18:30

1 Answer 1

1

I haven't tried Cloud Run but whenever I've had this issue it was due to the folder not having permissions for the user/group that PHP runs as. Typically it's www-data:www-data. In other words you might need to use chown instead of chmod.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.