Magento – PHP memory limit

magento2PHP

I installed magento 2 and is working fine. I am trying to install through the component manager an extension (magento mag/module blog). I keep getting the message:

"PHP Settings Check: Your current PHP memory limit is 128M.
Magento 2 requires it to be set to 756M or more. As a user with root privileges,
edit your php.ini file to increase memory_limit.
(The command php –ini tells you where it is located.) After that, restart your web server and try again."

My php.ini is in my public_html folder (same as magento 2 installation) and is set to 756M, yey i keep getting the same message…any help? If I try to install any of the other magento updates I have in the component manager, I get the same message.

Best Answer

2 things you need to remember:

  • memory limit is set in basic php.ini file, most often in location like /etc/php/X.X/fpm/php.ini and /etc/php/X.X/cli/php.ini (this varies depending on the system and whether you use php as a service or not). Those settings also tells php whether you can override those default values with your custom ones in php.ini file in your document root folder.

  • as you noticed above there are 2 paths for php.ini. If you use php-fpm then you have 2 independent settings for php run via apache/nginx as a response to http request and another set of settings for scripts run from the console (ie. bin/magento or composer).

Now if your system tells you memory limit is 128M then it does not lie. Either your default settings forbids you from settings memory limit in project folder or vhost settings points not to the file you are using to change the settings.

Related Topic