I am trying to install an extension and ran into memory problem.
The error message: mmap() failed: [12] cannot allocate memory php fatal error: out of memory
I read some instructions on Magento website and reckon i need to set the memory size in php.ini to 2GB. However, I am not able to find php.ini file.
My website is on a shared server. I ran php --ini command and got below information
php --ini
Configuration File (php.ini) Path: /usr/local/php70/lib
Loaded Configuration File: /usr/local/php70/lib/php.ini
Scan for additional .ini files in: /usr/local/php70/etc
Additional .ini files parsed: /usr/local/php70/etc/extensions.ini, /usr/local/php70/etc/limits.ini
But I can't figure out where /usr is......
I contacted my web host and found that I only can have max 768Mb for memory_limit in php.ini because it is a shared server. Is there a way to get around this?
Hi @WZ_OZES
Are you installing this extension using SSH terminal by running command ?
@Manthan Davewrote:Hi @WZ_OZES
Are you installing this extension using SSH terminal by running command ?
Hi ManthanDave, yes I am using SSH terminal to run the commands.
You can find your php.ini file from different OS based on below link,
Or you can run a command like pass memory limit in all command,
php -dmemory_limit=5G bin/magento setup:upgrade php -dmemory_limit=5G bin/magento setup:static-content:deploy -f php -dmemory_limit=5G bin/magento setup:di:compile php -dmemory_limit=5G bin/magento indexer:reindex php -dmemory_limit=5G bin/magento cache:flush
Thanks guys. But unfortunately php -d memory command doesn't work for me. I got error message after typing this command. I think my web server provider blocked this kind of operation because i use shared server.
however, I figured out a way to get around with this issue. I basically downloaded the extension to my magento folder and put it at the exact directory the developer specified. Then I did composer update. Then it worked and installed the extension for me.
This is the extension I tried to install https://marketplace.magento.com/sy-slider.html
On the other note, I saw there is someone talking about creating a swap file to overcome insufficient memory issue but I am unable to understand because that needs to know what operation system my server uses. Anyone can share some info on this?
Check if this can help?
php -d memory_limit=-1 bin/magento [your_command]
-1 parameter is for unlimited memory.
---
Also please tell which is your memory allowed size in php.ini
Run this:
php -i | grep "memory"