简体   繁体   中英

How to change dokku PHP memory_limit?

I am hosting a WP blog on dokku, but there are stability issues, I suspect memory so I want to increase memory available to PHP, specifically, to set custom memory_limit value.

I am running on dokku v0.5.6 , and using BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php#102

To debug the PHP settings of my blog app I run

dokku run blog php -ini | grep memory_limit
#=> memory_limit => 128M => 128M

I have followed the suggestions in

  1. Heroku PHP ini documentation
  2. Heroku PHP concurrency documentation
  3. Dokku issue #1098

Specifically:

  1. made .user.ini with memory_limit = 256M
  2. made fmp_custom.ini with content php_value[memory_limit] = 256M
  3. made php_custom.ini with content memory_limit = 256M
  4. made Procfile with web: vendor/bin/heroku-php-nginx -C nginx.conf -F fpm_custom.ini -i php_custom.ini
  5. I have even forked the heroku buildpack and made a /conf/php/php.ini with content memory_limit = 256M

Neither strategy has yielded the desired output of

dokku run blog php -ini | grep memory_limit
#=> memory_limit => 256M => 256M

What am I missing? I am doubtful that nothing has affected PHP init settings, perhaps I am debugging incorrectly?

All the custom settings are related to the current thread of the app server process. In other words, if you check the phpInfo() output you can see that your php_custom.ini works as expected:

https://www.dropbox.com/s/u4pe88pcpkwl6rm/2016-06-05_0.10.51.png?dl=0

but the php -ini | grep memory_limit php -ini | grep memory_limit is still show you 128MB, because the php call spawns a new thread, especially if you run another container of your app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM