I have Magento 2.1.3 setup on Godaddy shared hosting and after much struggling around with php.ini files, the web host has decided that Magento is showing the global memory limit (512MB) on the server rather than the local memory limit (2048MB). Obviously, the host is unwilling to change the global memory limit, so my question here is how can I force Magento to look at the local php.ini file within my hosting? If it is not possible, please suggest me another way to proceed.
Solved! Go to Solution.
As known as i know - in some case specially in shared hosting scenario if you update this memory via .htaccess or other thing Server will always take PHP Global memory - because they have restricted from server end
So here i would suggest you to raise a ticket on godaddy helpdesk or ask their support team to increase this values - they will do it on behalf of you.
You just need to give exact values to them and they will do it on behalf of you - also i would suggest you to increase - max_execution_time as well , put this max_execution_time value = 18000.
Hope it helps !
Hello @Rishi Ranjan
Update the memory_limit with the .htaccess file: if not
php_value memory_limit XXXXM
If not find in .htacess then add like this:
<IfModule mod_php7.c> ############################################ ## adjust memory limit php_value memory_limit 2000M php_value max_execution_time 18000 ############################################ </IfModule>
@Manish Mittal I have tried above both method but still, Magento showing "your current memory_limit is 512M"
As known as i know - in some case specially in shared hosting scenario if you update this memory via .htaccess or other thing Server will always take PHP Global memory - because they have restricted from server end
So here i would suggest you to raise a ticket on godaddy helpdesk or ask their support team to increase this values - they will do it on behalf of you.
You just need to give exact values to them and they will do it on behalf of you - also i would suggest you to increase - max_execution_time as well , put this max_execution_time value = 18000.
Hope it helps !
If this is not working then please approach GoDaddy technical support you can raise a ticket or can directly chat with them they will fix this for you. Share with then what value need to fix this.
@Manish Mittal As I already mentioned above the host is unwilling to change the global memory limit, so my question here is how can I force Magento to look at the local php.ini file within my hosting? If it is not possible, please suggest me another way to proceed.
In that case, You have to contact with support team.
How can I solved if the Hosting support can or want not change it?
Please I have the same problem
Atte.
Ricardo
@Ricardo_Vega wrote:How can I solved if the Hosting support can or want not change it?
Please I have the same problem
Atte.
Ricardo
If your hosting provider is unwilling to assist with this, you may need to consider going with a hosting provider who specializes in Magento.
If you are unable to modify the global memory limit on your shared hosting environment, there are a few alternative approaches you can try to resolve the PHP memory limit error during extension installation in Magento 2. Here are some suggestions:
1. .htaccess File: You can try adding the following line to your Magento installation's .htaccess file:
```
php_value memory_limit 2048M
```
This directive sets the memory limit to 2048MB specifically for your Magento installation. However, note that not all hosting providers allow changing PHP settings through .htaccess files, so this may or may not work depending on your hosting environment.
2. Local php.ini File: If you have access to the root directory of your Magento installation, you can try creating a local php.ini file. Follow these steps:
a. Create a new file named `php.ini` in the root directory of your Magento installation.
b. Add the following line to the `php.ini` file:
```
memory_limit = 2048M
```
Save the file and try the installation process again. However, keep in mind that some shared hosting providers may not allow overriding PHP settings via local `php.ini` files.
3. Memory Limit in Code: If none of the above options work, you can try increasing the memory limit directly in your Magento code. Locate the file `app/bootstrap.php` in your Magento installation and add the following line at the top:
```
ini_set('memory_limit', '2048M');
```
This line sets the memory limit to 2048MB specifically for your Magento installation. However, note that this change may only affect the installation process and not the overall runtime of your Magento website.
It's worth mentioning that shared hosting environments often have limitations and restrictions, and these workarounds may not always be effective. In such cases, it might be worth considering alternative hosting solutions, such as a virtual private server (VPS) or managed hosting, which provide more control over the server environment and PHP configuration.
If the issue persists or you require further assistance, it's advisable to reach out to Magento support or consult with a developer familiar with Magento and server configuration to help troubleshoot the memory limit error in your specific hosting environment.