[Self Hosting] Modifying PHP memory limit

Step1 Connect to the server through SSH then role as root user

$ ssh -i YOUR-KEY-FILE ec2-user@IP-ADDRESS-OF-YOUR-INSTANCE
$ sudo su -

 

Step2 Check php.ini.erb 

# vi /opt/local/chef-repo/cookbooks/amimoto/templates/default/php/php.ini.erb

The memory_limit value should be
memory_limit = <%= @memory_limit %>
If you set another value, change above.


Step3 Modify middlewares.rb

# vi /opt/local/chef-repo/cookbooks/amimoto/attributes/middlewares.rb
default[:php][:config][:max_execution_time] = node[:nginx][:config][:proxy_read_timeout]

Add the following line to under the above line.

default[:php][:config][:memory_limit] = '128M'

* No need if you alread added.

 

Step4 Modify amimoto.json

# vi /opt/local/amimoto.json

Add the following code, under thephp config.

"memory_limit": "512M",
* 512M is sample value, edit it as you like.

 

Step5 Apply settings

run /opt/local/provision to apply settings.
* It takes a little time.

# /opt/local/provision

That's all for modifying PHP memory limit

Put the file phpinfo.php on /var/www/vhosts/YOUR-DOMAIN/, check modification is applied.

 

You can override the value listed in https://github.com/Launch-with-1-Click/lw1-amimoto/tree/2016.01/attributes in the same way.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk