{"id":26282,"date":"2022-05-31T09:54:27","date_gmt":"2022-05-31T09:54:27","guid":{"rendered":"https:\/\/1-grid.com\/knowledge\/?p=26282"},"modified":"2023-11-14T10:13:03","modified_gmt":"2023-11-14T10:13:03","slug":"how-to-modify-php-settings-through-htaccess","status":"publish","type":"ht_kb","link":"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/","title":{"rendered":"How to Modify PHP-settings through .htaccess"},"content":{"rendered":"<blockquote dir=\"ltr\"><p><span style=\"color: #000000;\">This article will show you how to Modify PHP- settings through .htaccess<\/span><\/p><\/blockquote>\n<p><span style=\"font-weight: 400;\">When it comes to optimizing your website&#8217;s performance, sometimes you might find the need to tweak PHP settings. Your server environment is typically finely tuned, but there could be scenarios where you need to adjust specific PHP directives. Fortunately, you can achieve this by creating or editing a .htaccess file.<\/span><\/p>\n<p><span style=\"color: #000000;\">The server environment is precisely tuned for performance, with hardware and software (and network). For PHP usage, this means that some of the server and environment settings may be a bit more modest than other providers. With most websites and applications, our settings are just fine.<\/span><\/p>\n<p><span style=\"color: #000000;\">But in some cases you may need to modify a PHP directive. To change a PHP-setting or variable, just set the new setting with a\u00a0<code>.htaccess<\/code>\u00a0file. Here\u2019s an example of directives that may be changed this way:<\/span><\/p>\n<p><code>php_value upload_max_filesize 200M<\/code><br \/>\n<code>php_value post_max_size 200M<\/code><br \/>\n<code>php_value max_input_vars 2000<\/code><br \/>\n<code>php_value max_execution_time 120<\/code><\/p>\n<p><span style=\"color: #000000;\">Here\u2019s a<\/span>\u00a0<a href=\"https:\/\/secure.php.net\/manual\/en\/ini.list.php\">complete list of all (configurable) directives.<\/a><\/p>\n<p><span style=\"color: #000000;\">In general, we don\u2019t recommend changing these directives. Temporary changes are always better than permanent ones. Again, our server environment is optimized for speed and changes may affect the performance of your website.<\/span><\/p>\n<p dir=\"ltr\"><span style=\"color: #000000;\">To view the default settings in our server environment, use the PHP-command\u00a0<code>phpinfo()<\/code>. Just create a new PHP file called<\/span>\u00a0<code>info.php<\/code>\u00a0<span style=\"color: #000000;\">with the following content:<\/span>\u00a0<code>&lt;?php phpinfo(); ?&gt;<\/code>, <span style=\"color: #000000;\">upload it to the root of your website and browse to it<\/span>:\u00a0<code>example.com\/info.php<\/code>.<\/p>\n<p><b>Frequently Asked Questions:<\/b><\/p>\n<ol>\n<li><b> Why should I be cautious when modifying PHP settings via .htaccess?<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Making incorrect or unnecessary changes to PHP settings can adversely affect your website&#8217;s performance. Our server environment is optimized for speed, so it&#8217;s better to avoid permanent modifications whenever possible.<\/span><\/p>\n<ol start=\"2\">\n<li><b> How can I check the default PHP settings on my server environment?<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">You can create a PHP file named &#8220;info.php&#8221; with the content &#8220;&lt;?php phpinfo(); ?&gt;&#8221; and upload it to your website&#8217;s root directory. Accessing this file via a web browser will display a comprehensive list of your server&#8217;s PHP settings.<\/span><\/p>\n<div id=\"collab-highlight-btn\" class=\"collab-highlight-btn \" role=\"button\"><\/div>\n<div id=\"ember3409\" class=\"attachment-thumb ember-view\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This article will show you how to Modify PHP- settings through .htaccess When it comes to optimizing your website&#8217;s performance, sometimes you might find the need to tweak PHP settings. Your server environment is typically finely tuned, but there could be scenarios where you need to adjust specific PHP directives&#8230;.<\/p>\n","protected":false},"author":21,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"ht-kb-category":[1174],"ht-kb-tag":[32,404,480,640,738,907,1011],"class_list":["post-26282","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-hosting","ht_kb_tag-htaccess","ht_kb_tag-file-manager","ht_kb_tag-how-to","ht_kb_tag-modify","ht_kb_tag-php","ht_kb_tag-settings","ht_kb_tag-through"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Modify PHP-settings through .htaccess -<\/title>\n<meta name=\"description\" content=\"This article will show you how to Modify PHP- settings through .htaccess How to Modify PHP-settings through .htaccess 1-grid Knowledge Base\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Modify PHP-settings through .htaccess -\" \/>\n<meta property=\"og:description\" content=\"This article will show you how to Modify PHP- settings through .htaccess How to Modify PHP-settings through .htaccess 1-grid Knowledge Base\" \/>\n<meta property=\"og:url\" content=\"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"1-grid Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/1grid.co.za\/\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-14T10:13:03+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@1grid_hosting\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/\",\"name\":\"How to Modify PHP-settings through .htaccess -\",\"isPartOf\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#website\"},\"datePublished\":\"2022-05-31T09:54:27+00:00\",\"dateModified\":\"2023-11-14T10:13:03+00:00\",\"description\":\"This article will show you how to Modify PHP- settings through .htaccess How to Modify PHP-settings through .htaccess 1-grid Knowledge Base\",\"breadcrumb\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/1grid.co.za\/knowledge\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Modify PHP-settings through .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#website\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/\",\"name\":\"1-Grid Domain Hosting Knowledge Base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/1grid.co.za\/knowledge\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#organization\",\"name\":\"1-Grid Domain Hosting Knowledge Base\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg\",\"contentUrl\":\"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg\",\"width\":100,\"height\":100,\"caption\":\"1-Grid Domain Hosting Knowledge Base\"},\"image\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/1grid.co.za\/\",\"https:\/\/twitter.com\/1grid_hosting\",\"https:\/\/www.instagram.com\/1grid_hosting\/\",\"https:\/\/za.linkedin.com\/company\/1-grid\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Modify PHP-settings through .htaccess -","description":"This article will show you how to Modify PHP- settings through .htaccess How to Modify PHP-settings through .htaccess 1-grid Knowledge Base","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:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to Modify PHP-settings through .htaccess -","og_description":"This article will show you how to Modify PHP- settings through .htaccess How to Modify PHP-settings through .htaccess 1-grid Knowledge Base","og_url":"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/","og_site_name":"1-grid Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/1grid.co.za\/","article_modified_time":"2023-11-14T10:13:03+00:00","twitter_card":"summary_large_image","twitter_site":"@1grid_hosting","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/","url":"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/","name":"How to Modify PHP-settings through .htaccess -","isPartOf":{"@id":"https:\/\/1grid.co.za\/knowledge\/#website"},"datePublished":"2022-05-31T09:54:27+00:00","dateModified":"2023-11-14T10:13:03+00:00","description":"This article will show you how to Modify PHP- settings through .htaccess How to Modify PHP-settings through .htaccess 1-grid Knowledge Base","breadcrumb":{"@id":"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/1grid.co.za\/knowledge\/how-to-modify-php-settings-through-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/1grid.co.za\/knowledge\/"},{"@type":"ListItem","position":2,"name":"How to Modify PHP-settings through .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/1grid.co.za\/knowledge\/#website","url":"https:\/\/1grid.co.za\/knowledge\/","name":"1-Grid Domain Hosting Knowledge Base","description":"","publisher":{"@id":"https:\/\/1grid.co.za\/knowledge\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/1grid.co.za\/knowledge\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/1grid.co.za\/knowledge\/#organization","name":"1-Grid Domain Hosting Knowledge Base","url":"https:\/\/1grid.co.za\/knowledge\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/","url":"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg","contentUrl":"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg","width":100,"height":100,"caption":"1-Grid Domain Hosting Knowledge Base"},"image":{"@id":"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/1grid.co.za\/","https:\/\/twitter.com\/1grid_hosting","https:\/\/www.instagram.com\/1grid_hosting\/","https:\/\/za.linkedin.com\/company\/1-grid"]}]}},"_links":{"self":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/26282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/comments?post=26282"}],"version-history":[{"count":4,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/26282\/revisions"}],"predecessor-version":[{"id":33056,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/26282\/revisions\/33056"}],"wp:attachment":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/media?parent=26282"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb-category?post=26282"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb-tag?post=26282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}