{"id":76,"date":"2016-02-02T17:03:26","date_gmt":"2016-02-02T17:03:26","guid":{"rendered":"https:\/\/docs.euthemians.com\/?post_type=ht_kb&#038;p=76"},"modified":"2021-02-01T15:15:21","modified_gmt":"2021-02-01T15:15:21","slug":"recommended-server-settings-memory-issues","status":"publish","type":"ht_kb","link":"https:\/\/docs.euthemians.com\/tutorials\/recommended-server-settings-memory-issues\/","title":{"rendered":"Recommended Server Settings (Vital)"},"content":{"rendered":"<p>There are hundreds of thousands of web hosts out there, not all of them are fit for a WordPress installation. There are a\u00a0few (well-known) low budget host providers that you can experience multiple issues when you use a premium, high quality theme (demo import issues, images upload etc). As you can easily understand this is out the scope of our support and something that you need to sort out with your host provider. At least, make sure you have covered the basics: <a href=\"https:\/\/wordpress.org\/about\/requirements\/\" target=\"_blank\" rel=\"nofollow noopener\">WordPress Minimum Requirements<\/a><\/p>\n<p>Recommended PHP and MySQL versions:<\/p>\n<ul>\n<li>PHP version 7.4 or greater.<\/li>\n<li>MySQL version 5.6 or greater o<em>r<\/em> MariaDB version 10.1 or greater.<\/li>\n<li>The mod_rewrite Apache module<\/li>\n<\/ul>\n<p>Themes and Plugins often require more memory than the server default values. In some server installations some php variables are very low and not recommended for WordPress installations with premium Themes or\/and multiple Plugins.<\/p>\n<p>Recommended php variable values:<\/p>\n<p><em>Snippet for php.ini<\/em><\/p>\n<pre>    memory_limit = 256M \r\n    post_max_size = 128M \r\n    upload_max_filesize = 32M  \r\n    max_input_vars = 3000\r\n    max_execution_time = 300\u200b\r\n<\/pre>\n<p><em>Snippet for .htaccess<\/em><\/p>\n<pre>  php_value memory_limit 256M\r\n  php_value post_max_size 128M\r\n  php_value upload_max_filesize 32M\r\n  php_value max_input_vars 3000\r\n  php_value max_execution_time 300\u200b\r\n<\/pre>\n<ul>\n<li>memory_limit ( This sets the maximum amount of memory in bytes that a script is allowed to allocate)<\/li>\n<li>post_max_size ( <span class=\"simpara\">Sets max size of post data allowed. This setting also affects file upload. <\/span>)<\/li>\n<li>upload_max_filesize ( The maximum size of an uploaded file. e.g: Theme, Plugin, Media File )<\/li>\n<li>max_input_vars ( Increase to 2000 to enable large menus with many menu items e.g &gt; 80 )<\/li>\n<li>max_execution_time (The maximum time in seconds a script is allowed to run before it is terminated )<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> If you have already a larger number or if you don&#8217;t have any issues, you don&#8217;t need to modify them.<\/p>\n<p>Keep in mind that some values must be larger than others<strong>: <\/strong><strong>memory_limit &gt; post_max_size &gt; upload_max_filesize<\/strong><\/p>\n<p>These values can be changed with the following methods:<\/p>\n<ul>\n<li>inform your hosting provider to do it for you<\/li>\n<li>from you hosting panel<\/li>\n<li>php.ini ( FTP access required )<\/li>\n<li>.htaccess ( FTP access required )<\/li>\n<\/ul>\n<p>One of the most important files in your WordPress installation is the <tt>wp-config.php<\/tt> file. This file is located in the root of your WordPress file directory and contains your website&#8217;s base configuration details, such as database connection information.<\/p>\n<p><b>WP_MEMORY_LIMIT<\/b> option allows you to specify the maximum amount of memory that can be consumed by PHP. This setting may be necessary in the event you receive a message such as &#8220;Allowed memory size of xxxxxx bytes exhausted&#8221;.<\/p>\n<p>This setting increases PHP Memory only for WordPress, not other applications. By default, WordPress will attempt to increase memory allocated to PHP to 40MB. <a href=\"https:\/\/wordpress.org\/support\/article\/editing-wp-config-php\/\" target=\"_blank\" rel=\"nofollow noopener\"><span id=\"Increasing_memory_allocated_to_PHP\" class=\"mw-headline\">Increasing memory allocated to PHP<\/span><\/a><\/p>\n<p>Increase PHP Memory to 96M<\/p>\n<pre>define( 'WP_MEMORY_LIMIT', '96M' );\r\n<\/pre>\n<p>Administration tasks require much memory than usual operation. When in the administration area, the memory can be increased or decreased from the <tt>WP_MEMORY_LIMIT<\/tt> by defining <tt>WP_MAX_MEMORY_LIMIT<\/tt>.<\/p>\n<pre>define( 'WP_MAX_MEMORY_LIMIT', '256M' );\r\n<\/pre>\n<p>Please note, this has to be put before wp-settings.php inclusion.<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht_kb_category":[105],"ht_kb_tag":[61,57,58,59,60],"class_list":["post-76","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-general","ht_kb_tag-corpus","ht_kb_tag-demo-import","ht_kb_tag-memory-issues","ht_kb_tag-php","ht_kb_tag-recommended"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/ht_kb\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":9,"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/ht_kb\/76\/revisions"}],"predecessor-version":[{"id":1949,"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/ht_kb\/76\/revisions\/1949"}],"wp:attachment":[{"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/ht_kb_category?post=76"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/docs.euthemians.com\/wp-json\/wp\/v2\/ht_kb_tag?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}