Increase your Memory Limit via .htaccess or php.ini

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 support@madgenius.com.

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.

  • 58 Kasutajad peavad seda kasulikuks
Kas see vastus oli kasulik?

Seotud artiklid

How many log in attempts into cPanel before I am blocked?

5 consecutive attempts that fail will get you a permanent block. You will have to create a...

How to change cPanel password

There is two methods to changing your cPanel password. If you already know your password and can...

Do you offer cPanel addons?

Yes, we offer the following addons for an extra $2.50 per month : Fantastico shoutcast rvskins...

Custom php.ini for cPanel shared hosting

Do you want to modify the global php.ini file to accommodate a script you are installing. You...

Using Mailing lists

cPanel Tutorial: How to add mailing lists? This cPanel tutorial will show you how to add...