<p>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 <code>www-data:www-data</code>. In other words you might need to use <code>chown</code> instead of <code>chmod</code>.</p>

CC BY-SA 4.0
2021-08-09T03:46:33.383Z
2021-08-09T03:46:33.383Z
Judd Lyon
<p>I've been able to get Craft to run on Google App Engine (GAE), but not Cloud Run as of yet.</p>
<p>The error message I'm seeing in the browser is:</p>
<p><code>/app/craftcms/storage/runtime isn't writable by PHP. Please fix that.</code></p>
<p>I encountered this error when deploying to GAE and the solution was to have the Dockerfile run a shell script that <code>chmod 755 -R ./storage</code>. This approach does not work for Cloud Run as I still see the same message in the browser despite running the same script.</p>
<p>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?</p>

CC BY-SA 4.0
2024-01-26T10:22:27.443Z
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
Michael Hunziker
CC BY-SA 4.0
2024-01-29T22:13:47.877Z
@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
CC BY-SA 4.0
2024-01-31T14:20:30.217Z
Thanks a lot @Eric!
Michael Hunziker
CC BY-SA 4.0
2024-01-31T14:49:09.750Z
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?
Michael Hunziker
CC BY-SA 4.0
2024-01-31T15:14:03.970Z
Never mind...

I just figured out this is the only handler i need:

entrypoint: serve web/index.php

handlers:

  - url: .*
    script: auto
Michael Hunziker
CC BY-SA 4.0
2024-02-02T18:30:47.423Z
Sure thing @MichaelHunziker - happy to help
Eric
<deployment>
Is it possible to run Craft CMS on Google's Cloud Run?
# Is it possible to run Craft CMS on Google's Cloud Run?

(Asked by: username_0 on 2021-08-06)

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?

**Tags:** deployment
> **Comments:**
> **username_1**: 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  
> **username_0**: @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.  
> **username_1**: Thanks a lot @Eric!  
> **username_1**: 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?  
> **username_1**: Never mind...  I just figured out this is the only handler i need:  entrypoint: serve web/index.php  handlers:    - url: .*     script: auto  
> **username_0**: Sure thing @MichaelHunziker - happy to help  

---

## 1 answers

### Answer by username_2 on 2021-08-09. Score: 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`.


---

