{"id":554,"date":"2024-11-16T12:42:38","date_gmt":"2024-11-16T12:42:38","guid":{"rendered":"https:\/\/pondywebhosting.com\/blog\/?p=554"},"modified":"2024-11-16T12:42:51","modified_gmt":"2024-11-16T12:42:51","slug":"increase-php-memory-limit-in-cpanel","status":"publish","type":"post","link":"https:\/\/pondywebhosting.com\/blog\/increase-php-memory-limit-in-cpanel\/","title":{"rendered":"How to Increase PHP Memory Limit in cPanel ?"},"content":{"rendered":"\n<p>Increase <a href=\"https:\/\/www.php.net\/\" rel=\"nofollow noopener\" target=\"_blank\">PHP<\/a> Memory Limit in <a href=\"https:\/\/www.cpanel.net\/\" rel=\"nofollow noopener\" target=\"_blank\">cPanel<\/a> is a common task, especially when your website experiences memory-related errors like <em>\u201cAllowed memory size of X bytes exhausted\u201d<\/em>. This issue often arises in scenarios where web applications or plugins require more memory to execute processes. Below is a comprehensive, step-by-step guide on how to increase the PHP memory limit in cPanel, detailed to cover <a href=\"https:\/\/pondywebhosting.com\/web-hosting\/\">various hosting<\/a> configurations.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Increase PHP Memory Limit in cPanel<\/h2><nav><ul><li class=\"\"><a href=\"#step-1-log-in-to-your-c-panel-account\">Step 1: Log in to Your cPanel Account<\/a><\/li><li class=\"\"><a href=\"#step-2-locate-the-php-configuration-tools\">Step 2: Locate the PHP Configuration Tools<\/a><ul><li class=\"\"><a href=\"#option-1-php-selector\">Option 1: PHP Selector<\/a><\/li><li class=\"\"><a href=\"#option-2-multi-php-ini-editor\">Option 2: MultiPHP INI Editor<\/a><\/li><\/ul><\/li><li class=\"\"><a href=\"#step-3-increase-the-php-memory-limit\">Step 3: Increase PHP Memory Limit in cPanel<\/a><ul><li class=\"\"><a href=\"#using-php-selector\">Using PHP Selector:<\/a><\/li><li class=\"\"><a href=\"#using-multi-php-ini-editor\">Using MultiPHP INI Editor:<\/a><\/li><\/ul><\/li><li class=\"\"><a href=\"#step-4-verify-the-changes\">Step 4: Verify the Changes<\/a><\/li><li class=\"\"><a href=\"#step-5-troubleshooting\">Step 5: Troubleshooting<\/a><\/li><li class=\"\"><a href=\"#why-increase-the-php-memory-limit\">Why Increase PHP Memory Limit in cPanel?<\/a><\/li><li class=\"\"><a href=\"#precautions\">Precautions<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-log-in-to-your-c-panel-account\"><strong>Step 1: Log in to Your cPanel Account<\/strong><\/h3>\n\n\n\n<p>To begin:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your web browser and navigate to your hosting provider\u2019s cPanel login page.<\/li>\n\n\n\n<li>Enter your username and password.<\/li>\n\n\n\n<li>Click <strong>Login<\/strong> to access the cPanel dashboard.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"545\" height=\"438\" src=\"http:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/06\/image-7.png\" alt=\"Index Manager in cPanel\" class=\"wp-image-373\" srcset=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/06\/image-7.png 545w, https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/06\/image-7-300x241.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/figure>\n\n\n\n<p>Once logged in, you\u2019ll find several tools for managing your hosting environment, including PHP configurations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-locate-the-php-configuration-tools\"><strong>Step 2: Locate the PHP Configuration Tools<\/strong><\/h3>\n\n\n\n<p>In cPanel, there are typically two primary tools you can use to modify the PHP memory limit: <strong>PHP Selector<\/strong> and <strong>MultiPHP INI Editor<\/strong>. The option available depends on your hosting provider\u2019s setup.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1172\" height=\"280\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/image-9.png\" alt=\"\" class=\"wp-image-555\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"option-1-php-selector\"><strong>Option 1: PHP Selector<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the cPanel dashboard, look for <strong>Select PHP Version<\/strong> or <strong>PHP Selector<\/strong> under the <strong>Software<\/strong> section.<\/li>\n\n\n\n<li>Click to open it, and select your current PHP version (if not already selected).<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"467\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/image-10.png\" alt=\"\" class=\"wp-image-562\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Look for an option such as <strong>Switch to PHP Options<\/strong> or <strong>Options<\/strong> to access editable PHP settings.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"option-2-multi-php-ini-editor\"><strong>Option 2: MultiPHP INI Editor<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Alternatively, find and click <strong>MultiPHP INI Editor<\/strong>, also located in the <strong>Software<\/strong> section.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"294\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/1400_look-for-the-MultiPHP-INI-Editor.png\" alt=\"\" class=\"wp-image-556\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This tool allows you to directly edit the <code>php.ini<\/code> configuration for specific domains or directories.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"230\" height=\"49\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/1401_click-on-Basic-mode.png\" alt=\"\" class=\"wp-image-557\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1295\" height=\"354\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/1403_list-of-directives.png\" alt=\"\" class=\"wp-image-558\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>From the dropdown menu, choose the domain or directory you wish to modify.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-increase-the-php-memory-limit\"><strong>Step 3: Increase PHP Memory Limit in cPanel<\/strong><\/h3>\n\n\n\n<p>Once you\u2019ve accessed the appropriate tool, follow these steps to modify the memory limit:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"using-php-selector\"><strong>Using PHP Selector:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the PHP Options, locate <strong>memory_limit<\/strong> in the list of settings.<\/li>\n\n\n\n<li>Click the value next to it, and either select or manually enter a higher limit (e.g., <code>256M<\/code>, <code>512M<\/code>, or another suitable value).<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1071\" height=\"406\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/image-11.png\" alt=\"\" class=\"wp-image-563\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Save your changes to apply the new memory limit.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"420\" height=\"119\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/image-12.png\" alt=\"\" class=\"wp-image-564\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"using-multi-php-ini-editor\"><strong>Using MultiPHP INI Editor:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After selecting your domain, a list of PHP directives will appear.<\/li>\n\n\n\n<li>Scroll to find <strong>memory_limit<\/strong>. <\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"193\" height=\"360\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/1404_locate-the-memory_limit-directive.png\" alt=\"Increase PHP Memory Limit in cPanel\" class=\"wp-image-559\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Modify the value by entering your desired limit (e.g., <code>256M<\/code> or <code>512M<\/code>).<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"269\" height=\"60\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/1405_value-to-a-higher-limit.png\" alt=\"\" class=\"wp-image-560\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click <strong>Apply<\/strong> or <strong>Save<\/strong> to confirm the changes.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"95\" height=\"52\" src=\"https:\/\/pondywebhosting.com\/blog\/wp-content\/uploads\/2024\/11\/1406_click-the-Apply-button.png\" alt=\"\" class=\"wp-image-561\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-verify-the-changes\"><strong>Step 4: Verify the Changes<\/strong><\/h3>\n\n\n\n<p>It\u2019s important to confirm that Increase PHP Memory Limit in cPanel is now active. To do this:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a <code>phpinfo.php<\/code> file in your website\u2019s root directory:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open any text editor and insert the following code:<br><code>php &lt;?php phpinfo(); ?&gt;<\/code><\/li>\n\n\n\n<li>Save the file as <code>phpinfo.php<\/code> and upload it to your website\u2019s root folder using the cPanel File Manager or an FTP client.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your web browser and navigate to <code>http:\/\/yourdomain.com\/phpinfo.php<\/code>.<\/li>\n\n\n\n<li>On the resulting page, search for the <strong>memory_limit<\/strong> directive to confirm it reflects the new value.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-5-troubleshooting\"><strong>Step 5: Troubleshooting<\/strong><\/h3>\n\n\n\n<p>If the new memory limit doesn\u2019t take effect:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Check for Application Overrides:<\/strong> Some applications (e.g., WordPress, Joomla, or Magento) may have their own configurations in files like <code>.htaccess<\/code>, <code>php.ini<\/code>, or <code>wp-config.php<\/code>. Update the memory limit in these files as needed.<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For WordPress, edit the <code>wp-config.php<\/code> file and add the line:<br><code>php define('WP_MEMORY_LIMIT', '256M');<\/code><\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Server Restrictions:<\/strong> On shared hosting plans, the maximum PHP memory limit may be restricted by your hosting provider. Contact their support team for further assistance if necessary.<\/li>\n\n\n\n<li><strong>File Permissions:<\/strong> Ensure the <code>php.ini<\/code> or <code>.htaccess<\/code> file you edited has the correct permissions for changes to be applied.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"why-increase-the-php-memory-limit\"><strong>Why Increase PHP Memory Limit in cPanel?<\/strong><\/h3>\n\n\n\n<p>Increasing the PHP memory limit is essential for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Handling Resource-Intensive Applications:<\/strong> Applications like WordPress, Drupal, or Joomla often require higher memory for plugins or themes.<\/li>\n\n\n\n<li><strong>Avoiding Script Failures:<\/strong> Large files or complex scripts can fail without sufficient memory.<\/li>\n\n\n\n<li><strong>Improved Performance:<\/strong> Allowing more memory ensures smoother operation of dynamic websites.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"precautions\"><strong>Precautions<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Avoid Overuse:<\/strong> Setting an excessively high memory limit on shared hosting can impact server performance and affect other users.<\/li>\n\n\n\n<li><strong>Consider Your Hosting Plan:<\/strong> If your hosting plan consistently struggles with memory limits, upgrading to a VPS or dedicated server may be a better long-term solution.<\/li>\n<\/ol>\n\n\n\n<p>By following this guide, you can successfully Increase PHP Memory Limit in cPanel and ensure your applications run smoothly. Confirm your changes and monitor your website\u2019s performance to avoid further issues. Let me know if you encounter any challenges!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Increase PHP Memory Limit in cPanel is a common task, especially when your website experiences memory-related errors like \u201cAllowed memory size of X bytes exhausted\u201d. This issue often arises in&hellip;<\/p>\n","protected":false},"author":4,"featured_media":569,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[73],"class_list":["post-554","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","tag-increase-php-memory-limit-in-cpanel"],"_links":{"self":[{"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/comments?post=554"}],"version-history":[{"count":3,"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/554\/revisions"}],"predecessor-version":[{"id":568,"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/554\/revisions\/568"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/media\/569"}],"wp:attachment":[{"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/media?parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/categories?post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pondywebhosting.com\/blog\/wp-json\/wp\/v2\/tags?post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}