问题
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
- Heroku PHP ini documentation
- Heroku PHP concurrency documentation
- Dokku issue #1098
Specifically:
- made
.user.ini
withmemory_limit = 256M
- made
fmp_custom.ini
with contentphp_value[memory_limit] = 256M
- made
php_custom.ini
with contentmemory_limit = 256M
- made
Procfile
withweb: vendor/bin/heroku-php-nginx -C nginx.conf -F fpm_custom.ini -i php_custom.ini
- I have even forked the heroku buildpack and made a
/conf/php/php.ini
with contentmemory_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