How to increase memory_limit using .htaccess in cPanel?

Please refer to the following steps to increase PHP memory_limit.

  1. Login to your cPanel. Please refer to how to open cPanel.

  2. Click on the file manager and find the .htaccess file for your website. If you don't have an existing .htaccess file then you can create a new .htaccess file. Please refer to how to create a file in cPanel.

  3. Open the .htaccess file and add the below line. You can change PHP memory_limit as per your requirement.

    # <IfModule mod_php7.1>
        php_value memory_limit 64M
  4. Create a php info file. Please refer to how to create a phpinfo file for more details.

  5. Access the phpinfo page in the browser and verify your memory_limit that you have set.

Was this answer helpful?

« Back


/* */