First off, there are two different ways to increase the memory limit on a hosting account You could either change it in the .htaccess file or the php.ini file. I will be covering both, so if one method doesn’t work for you please try the other.
The servers php.ini file is normally located in unreachable location (unless you are on a VPS or virtual private server), There is however a catch, you can, in most circumstances, create one in your root directory and it will override the servers. To do so follow the steps below. I will be covering cPanel as it is what I and most others on shared or reseller hosting are using.
1.) Login to cPanel. If you don’t know how to do this email firstname.lastname@example.org.
2.) Scroll down until you see the “File Manager” and click to select it.
3.) Another window will pop-up. Select “Web Root” and check the box that says “Show Hidden Files“, it should be the first check box.
4.) Once in the file manager window, in the upper left hand corner click on “New File.” Enter the name “php.ini” without the quotes. Then click Create New File to save it.
5.) Click on your file in the file list to select it. Then click Code Editor to open it in the web editor. In the pop-up window just click Edit.
Here is where we will enter the code to override the server configuration. Again this will only work if your web host allows it.
The code is:
memory_limit = 8M
Also be sure to replace the number “8″ with how many megabytes of memory you need. Also be warned that some host will not allow more than a certain amount of memory to be used by a single user so check with your host first to avoid any confrontation.
(Note: If the above works for you, you do not need to edit the .htaccess file. You will only need to edit one or the other. Do not edit both!)
Now for the .htaccess file:
Follow the above steps 1-4 only this time name the file to be created .htaccess instead of php.ini.
Then add this line of code and replace the “16″ with the amount of memory in megabytes you need.
php_value memory_limit 16M
(Note: After editing either the .htaccess or php.ini files click the Save Changes button in the upper right-hand corner.)
That should be it! Easy as pie.