How to change dokku PHP memory_limit?

萝らか妹 提交于 2019-12-07 13:30:41

问题


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?


回答1:


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 is still show you 128MB, because the php call spawns a new thread, especially if you run another container of your app.



来源:https://stackoverflow.com/questions/37298727/how-to-change-dokku-php-memory-limit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!