How to increase the server memory limit for OpenCart

How to increase the server memory limit for OpenCart

Here is a quick tip on how to increase the server memory limit for OpenCart should you ever need it if you use modules like ExcelPort or any similar in order to copy/transfer mass database information.

The server settings that should be modified are:

memory_limit – this setting affects the Export functionality (for modules like ExcelPort). You should increase it in case you receive errors on this feature.
max_execution_time – it is recommended to use a higher value in case your database has lots of entries. It is estimated that a database with about 80.000 products takes about 5-6 minutes to get backed up. You should be fine if you set this setting at 600 seconds.
upload_max_filesize – this sets the maximum file size that your server can accept. Set it accordingly to the file you need to upload.
post_max_size – usually a bit higher than upload_max_filesize setting.

Method 1 – Modify your php.ini file with the following entries:

memory_limit = 256M 
max_execution_time = 600 
upload_max_filesize = 200M 
post_max_size = 201M

Method 2 – In your /admin/ folder of OpenCart, create an .htaccess file with the following entries:

php_value memory_limit 256M
php_value max_execution_time 600
php_value upload_max_filesize 200M
php_value post_max_size 201M

By janoshke

Web developer and IT consultant. Freelancer with full respect for OpenCart and WordPress. Gamer, (ex)drummer and parent.

Leave a Reply