# Recommended way to increase PHP memory limit in Docker

**URL:** <https://community.fly.io/t/recommended-way-to-increase-php-memory-limit-in-docker/6349>\
**Category:** Questions / Help\
**Created:** [August 11, 2022, 2:41am UTC](https://community.fly.io/t/recommended-way-to-increase-php-memory-limit-in-docker/6349 "2022-08-11T02:41:45Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![fideloper-fly](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/fideloper-fly/32/3834_2.png) [@fideloper-fly](https://community.fly.io/u/fideloper-fly)\
**Post date:** [August 11, 2022, 1:01pm UTC](https://community.fly.io/t/recommended-way-to-increase-php-memory-limit-in-docker/6349/4 "2022-08-11T13:01:20Z")

</div>

The `docker/php.ini` file is used to set some settings for PHP. It [looks like this](https://github.com/superfly/flyctl/blob/master/scanner/templates/laravel/common/docker/php.ini).

Update these:

```ini
post_max_size = 2M
upload_max_filesize = 0M
memory_limit = 128M

```

Based on your error message it sounds like it’s related to `memory_limit` specifically. Do you know how large the file is? Using streaming should, in theory, be efficient enough to not need a high PHP limit. But if you need to increase the memory limit, you can!

Don’t forget your Fly virtual machine has its own cap on memory usage ([default of 256m](https://fly.io/docs/about/pricing/) for the free tier).

---

_[View the full topic](https://community.fly.io/t/recommended-way-to-increase-php-memory-limit-in-docker/6349)._
