Knowledgebase
How to raise php memory_limit
Posted by - NA - on 25 September 2012 03:49 PM
There are three ways to raise your server's php memory_limit:

Important: If you do not know what you are doing here, please ask your web hosting company to do this for you.

1. If you control the server (e.g. dedicated server) and have admin access, you can edit the server's php.ini file and set the memory_limit directive. Make sure to restart the web server (usually apache) when you've made your changes so that they will be activated. If you need help finding your php.ini file, visit your shop's admin, click summary, find the php version and click the details link to the right. The table at the top will show you the path to your php.ini file as "loaded configuration file."

2. If your server is running apache with mod_php, you may be able to override the memory_limit value with the following code placed in a file named ".haccess"

php_value memory_limit 256M

3. If your server is running fastcgi, and php 5.3 or later, you can add your own configuration by editing a file named ".user.ini" in your x-cart folder. Place the following code in .user.ini

memory_limit = 256M

4. If your server is running fastcgi and php 5.2 or lower, you can still add your own configuration override values, but you'll need to consult your host's helpdesk or documentation for the exact way to go about this. For example, your host may tell you to put your configuration directives in a php.ini file in the root of your site and the changes will take effect within an hour. Please consult your host, though, for exact details.

If you're using methods 2 or 3, you can check that your change is in effect by following these steps:

1. Visit your shop's admin
2. Click summary
3. Find the php version and click the details link to the right.
4. Locate the memory_limit directive and check the "local value" column - this should match your desired value

For more information, please see the php documentation for memory_limit:
http://php.net/manual/en/ini.core.php#memory_limit

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: