{"id":656,"date":"2016-06-13T20:34:34","date_gmt":"2016-06-13T20:34:34","guid":{"rendered":"https:\/\/www.copahost.com\/blog\/?p=656"},"modified":"2024-11-03T12:39:27","modified_gmt":"2024-11-03T12:39:27","slug":"increase-php-memory-limit-cpanel","status":"publish","type":"post","link":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/","title":{"rendered":"How to increase PHP Memory Limit in cPanel"},"content":{"rendered":"<p>In this article, we will explain the PHP Memory limit error in cPanel, and show a quick and easy solution for it. It requires a simple access to the <a href=\"https:\/\/www.copahost.com\/blog\/cpanel\/\">cPanel<\/a> shared hosting account.<\/p>\n<h3>Why does the Memory limit error happens ?<\/h3>\n<p>Sometimes when you execute a PHP script, you will notice that it returns an error like &#8220;Fatal Error: Allowed memory size of XX bytes exhausted&#8221;. This happens because the amount of memory allocated to the PHP script has exhausted, and as a consequence, the script cannot finish its execution. It&#8217;s already known as <a href=\"https:\/\/www.copahost.com\/blog\/fix-php-register-globals-errors\/\">PHP Memory Limit Error<\/a>.<\/p>\n<p>The amount of memory available to PHP is defined by the term memory_limit in your server&#8217;s PHP settings. With the help of cPanel, you can change this value to anything you like. How that can be done is described below.<\/p>\n<h3>How to fix this issue<\/h3>\n<p>First, log in to your <a href=\"https:\/\/www.copahost.com\/blog\/create-cpanel-reseller-hosting-account-whm\/\">cPanel account<\/a> using your cPanel username and Password. If you forgot the password, you can reset it using the &#8216;Reset Password&#8217; option on the same page.<\/p>\n<p><a href=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php1.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-647\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php1.jpg\" alt=\"php1\" width=\"1113\" height=\"603\" \/><\/a><\/p>\n<p>Once you are in the dashboard, go to Software -&gt; Select <a href=\"https:\/\/www.copahost.com\/blog\/check-update-php-version-cpanel\/\">PHP Version<\/a>.<\/p>\n<p><a href=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php2.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-648\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php2.jpg\" alt=\"php2\" width=\"1343\" height=\"601\" \/><\/a><\/p>\n<p>Click on it and it will take you to an interface where you can change the PHP version and select\/deselect extensions. To the top right side of the page, you will see another option &#8216;Switch to PHP Options&#8217;.<\/p>\n<p><a href=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php6.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-657\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php6.jpg\" alt=\"php6\" width=\"1337\" height=\"634\" \/><\/a><\/p>\n<p>Click on it and you will reach an interface which displays the various PHP variables and its associated values. They become grey by default. To change the PHP memory limit, click on the value to the right side of memory_limit. Then, a drop-down will appear with possible values you can choose. Select the value you require and hit &#8216;Apply&#8217;. After that scroll down to the bottom and click on &#8216;Save&#8217;. Only then the changes will be fully applied.<\/p>\n<p><a href=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-658 size-full\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php7.jpg\" alt=\"php memory limit\" width=\"1329\" height=\"632\" \/><\/a><\/p>\n<p>You can confirm whether your changes have got into effect by creating a <a href=\"https:\/\/www.copahost.com\/blog\/php-upload-multiple-files\/\">PHP file<\/a> with the following contents in it. Suppose I create a file named info.php. Enter the following into it.<\/p>\n<pre class=\"lang:default decode:true\">&lt;?php\n\nphpinfo();\n\n?&gt;<\/pre>\n<p>Save the file and upload it into your domain&#8217;s public_html folder. Our <a href=\"https:\/\/www.copahost.com\/blog\/what-is-a-domain-name\/\">domain name<\/a> is copablog.com and we can view the file as http:\/\/copablog.com\/info.php. You can now see your PHP settings in the browser by simply accessing http:\/\/copablog.com\/info.php in a browser. Search for the option &#8216;memory_limit&#8217; to confirm whether the new value you modified has taken effect. In my case, it is correctly showing it as 256M as displayed in the image below.<\/p>\n<p><a href=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php8.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-659 size-full\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/php8.jpg\" alt=\"memory limit\" width=\"1319\" height=\"666\" \/><\/a><\/p>\n<p>This is a very useful and easy way to get rid of the &#8220;Allowed memory size of XX bytes exhausted&#8221; message because you can change these configuration values in cPanel anytime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will explain the PHP Memory limit error in cPanel, and show a quick and easy solution for it. It requires a simple access to the cPanel shared hosting account. Why does the Memory limit error happens ? Sometimes when you execute a PHP script, you will notice that it returns an [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1849,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,133],"tags":[134,135],"class_list":["post-656","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","category-php","tag-memory-limit","tag-php-memory-limit"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to increase PHP Memory Limit in cPanel - Copahost<\/title>\n<meta name=\"description\" content=\"The post explains how one can change the PHP Memory Limit on their own with the help of cPanel. It can be done at a single click as explained in the post.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to increase PHP Memory Limit in cPanel - Copahost\" \/>\n<meta property=\"og:description\" content=\"The post explains how one can change the PHP Memory Limit on their own with the help of cPanel. It can be done at a single click as explained in the post.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"Copahost\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-13T20:34:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-03T12:39:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"842\" \/>\n\t<meta property=\"og:image:height\" content=\"428\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gustavo Bastos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gustavo Bastos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/\"},\"author\":{\"name\":\"Gustavo Bastos\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/79c41e5bdbfb917d1582160330fa0eca\"},\"headline\":\"How to increase PHP Memory Limit in cPanel\",\"datePublished\":\"2016-06-13T20:34:34+00:00\",\"dateModified\":\"2024-11-03T12:39:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/\"},\"wordCount\":466,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg\",\"keywords\":[\"memory limit\",\"php memory limit\"],\"articleSection\":[\"cPanel\",\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/\",\"name\":\"How to increase PHP Memory Limit in cPanel - Copahost\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg\",\"datePublished\":\"2016-06-13T20:34:34+00:00\",\"dateModified\":\"2024-11-03T12:39:27+00:00\",\"description\":\"The post explains how one can change the PHP Memory Limit on their own with the help of cPanel. It can be done at a single click as explained in the post.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg\",\"width\":842,\"height\":428},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.copahost.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to increase PHP Memory Limit in cPanel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"name\":\"Copahost\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.copahost.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\",\"name\":\"Copahost\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"width\":223,\"height\":40,\"caption\":\"Copahost\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/79c41e5bdbfb917d1582160330fa0eca\",\"name\":\"Gustavo Bastos\",\"url\":\"https:\/\/www.copahost.com\/blog\/author\/gbastos\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to increase PHP Memory Limit in cPanel - Copahost","description":"The post explains how one can change the PHP Memory Limit on their own with the help of cPanel. It can be done at a single click as explained in the post.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"How to increase PHP Memory Limit in cPanel - Copahost","og_description":"The post explains how one can change the PHP Memory Limit on their own with the help of cPanel. It can be done at a single click as explained in the post.","og_url":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/","og_site_name":"Copahost","article_published_time":"2016-06-13T20:34:34+00:00","article_modified_time":"2024-11-03T12:39:27+00:00","og_image":[{"width":842,"height":428,"url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg","type":"image\/jpeg"}],"author":"Gustavo Bastos","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Gustavo Bastos","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#article","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/"},"author":{"name":"Gustavo Bastos","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/79c41e5bdbfb917d1582160330fa0eca"},"headline":"How to increase PHP Memory Limit in cPanel","datePublished":"2016-06-13T20:34:34+00:00","dateModified":"2024-11-03T12:39:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/"},"wordCount":466,"commentCount":0,"publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg","keywords":["memory limit","php memory limit"],"articleSection":["cPanel","PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/","url":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/","name":"How to increase PHP Memory Limit in cPanel - Copahost","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg","datePublished":"2016-06-13T20:34:34+00:00","dateModified":"2024-11-03T12:39:27+00:00","description":"The post explains how one can change the PHP Memory Limit on their own with the help of cPanel. It can be done at a single click as explained in the post.","breadcrumb":{"@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#primaryimage","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/06\/increase-memory-limit-in-php-and-cpanel.jpg","width":842,"height":428},{"@type":"BreadcrumbList","@id":"https:\/\/www.copahost.com\/blog\/increase-php-memory-limit-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.copahost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to increase PHP Memory Limit in cPanel"}]},{"@type":"WebSite","@id":"https:\/\/www.copahost.com\/blog\/#website","url":"https:\/\/www.copahost.com\/blog\/","name":"Copahost","description":"","publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.copahost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.copahost.com\/blog\/#organization","name":"Copahost","url":"https:\/\/www.copahost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","width":223,"height":40,"caption":"Copahost"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/79c41e5bdbfb917d1582160330fa0eca","name":"Gustavo Bastos","url":"https:\/\/www.copahost.com\/blog\/author\/gbastos\/"}]}},"_links":{"self":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/comments?post=656"}],"version-history":[{"count":9,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions"}],"predecessor-version":[{"id":4145,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions\/4145"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/media\/1849"}],"wp:attachment":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/media?parent=656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/categories?post=656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/tags?post=656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}