Let’s first know about PHP memory limit uses for your hosting account. few scripts with higher memory limit are required when installing any CMS, E- Commerce, chat application, Fourm , gallery or block software. The server memory limits is set to 8 to 12 MB and it shouldn’t be more than that but any of your scripts under your hosting account requires a higher memory limit, then you can increase it from .htaccess file which is located in Public_Html folder in your file manager.
There are three Methods for increasing PHP memory limit.
- MultiPHP INI editor using basic mode
- MultiPHP INI editor using editor mode
- File manager using .htaccess file
METHOD 1: MultiPHP INI editor using basic mode
STEP 1: Open your cPanel and navigate to the software section and find MultiPhp INI Editor or you can directly search for that in the search box and click on it.
STEP 2: After that, you get MultiPHP INI Editor dashboard. you will see two modes there, Basic mode and Editor mode. in the first method, we will increase memory limits by using Basic mode. as you can see basic mode is by default selected.
STEP 3: now in Config PHP INI basic setting, select your domain name. after selecting the domain you will get a list of PHP directives offered by cPanel. scroll down and find memory_limit directive and change memory value as your requirement. and click on apply button.
for checking memory updated or not, again select your domain name in Config PHP INI basic setting and you will see memory increased.
METHOD 2: MultiPHP INI editor using editor mode
STEP 1: Follow Step 1 and STEP 2 of METHOD 1 but this time select on Editor mode. after clicking a Edit PHP INI Setting dashboard will be open. again select your domain.
STEP 2: As you can see Editor code is generated . in this code just find memory_limit word and update the size value as per your requirements. and click on the Save button.
for checking memory updated or not, again click on Basic mode and select your domain name in Config PHP INI basic setting and you will see memory increased.
METHOD 3: File manager using .htaccess file
STEP 1: Open your cPanel and from the file, section click on the file manager. on the left size select Public_html folder and double click on it or simply open it. on the right side, you will see all files and folders for your websites.
STEP 2: Just find the .htaccess file and right-click right on it and select the edit option
note – if you did not find the .htaccess file then you have to enable the hidden file option. for that click on the upper-right corner setting button and enable hidden file.
click on edit button
after clicking on the edit option one dialog box will appear which will ask you character encodings. just leave it as default and click on the edit button.
STEP 3: After clicking the edit button new window will appear containing PHP codes. again find memory_limit and adjust memory limits as per our requirements and click on the save changes button.
now for check updated memory limits again click on .htaccess file and now select the view option. you can see your memory limit increased.