{"id":1331,"date":"2021-05-10T12:00:56","date_gmt":"2021-05-10T09:00:56","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=1331"},"modified":"2022-05-18T15:24:42","modified_gmt":"2022-05-18T12:24:42","slug":"what-is-php-ini","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/what-is-php-ini\/","title":{"rendered":"What is php.ini?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">The php.ini file is the <\/span><b>standard configuration file<\/b><span style=\"font-weight: 400;\"> in <\/span><b>PHP-based applications<\/b><span style=\"font-weight: 400;\">. It is used to set upload sizes, display errors, resource limits, file timeouts, and many other things to manage the <\/span><b>Apache server.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">You already have default PHP settings installed on your server. There\u2019s no need to <\/span><b>create or edit a php.ini file<\/b><span style=\"font-weight: 400;\"> unless you need to modify one or more server settings.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, if you\u2019d like to make changes, keep reading to know how to edit existing php.ini files or create new ones.<\/span><\/p>\n<h2><b>How to Set Up a Custom php.ini File on SPanel<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Php.ini files contain <\/span><b>directives to manage <\/b><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-change-the-php-version-of-my-account\/\"><b>PHP-based<\/b><\/a><b> applications.<\/b><span style=\"font-weight: 400;\"> You can create one or multiple php.ini files that affect how your website will function.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A php.ini file can be in different folders. For instance, you might have one custom php.ini file in the <\/span><b>\/home\/username\/public_html <\/b><span style=\"font-weight: 400;\">directory, and another one for image files in the <\/span><b>\/home\/username\/public_html\/images <\/b><span style=\"font-weight: 400;\">directory.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To create a custom php.ini file, you\u2019ll need to <\/span><b>access the associated directory.<\/b><\/p>\n<p><b>Use the following steps to set up a custom php.ini file in your <\/b><a href=\"https:\/\/www.scalahosting.com\/spanel.html\"><b>SPanel<\/b><\/a><b> :<\/b><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\"> Log in to your SPanel account.<\/span><\/li>\n<li><span style=\"font-weight: 400;\"> Under <\/span><b>Files, <\/b><span style=\"font-weight: 400;\">click on <\/span><b>File manager\u00a0<\/b><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-1336 size-full\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image5.png\" alt=\"What is php.ini?, How to Set Up a Custom php.ini File on SPanel\" width=\"523\" height=\"304\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image5.png 523w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image5-300x174.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"3\">\n<li><span style=\"font-weight: 400;\"> If you want to modify a PHP file, now is the time to navigate the <\/span><b>public_html<\/b><span style=\"font-weight: 400;\"> directory and edit the desired folder. The changes you make will only affect that folder and nothing else.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">But, if you want to create custom php.ini files, go on with the next steps.<\/span><\/p>\n<ol start=\"4\">\n<li><span style=\"font-weight: 400;\"> Select <\/span><b>public_html<\/b><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1340\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image9.png\" alt=\"What is php.ini?, How to Set Up a Custom php.ini File on SPanel 2\" width=\"680\" height=\"129\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image9.png 680w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image9-300x57.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"5\">\n<li><span style=\"font-weight: 400;\"> Scroll down to the toolbar beneath the list of PHP files and <\/span><b>hit the \u201c+\u201d icon.<\/b><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1335\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image4.png\" alt=\"What is php.ini?, How to Set Up a Custom php.ini File on SPanel 3\" width=\"681\" height=\"213\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image4.png 681w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image4-300x94.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"6\">\n<li><span style=\"font-weight: 400;\"> In the pop-out, click <\/span><b>New File<\/b><span style=\"font-weight: 400;\">.\u00a0<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1333\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image2.png\" alt=\"What is php.ini?, How to Set Up a Custom php.ini File on SPanel 4\" width=\"652\" height=\"163\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image2.png 652w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image2-300x75.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"7\">\n<li><span style=\"font-weight: 400;\"> Input<\/span><b> php.ini<\/b><span style=\"font-weight: 400;\"> as the new name and press <\/span><b>OK<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1334\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image3.png\" alt=\"What is php.ini?, How to Set Up a Custom php.ini File on SPanel 5\" width=\"676\" height=\"132\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image3.png 676w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image3-300x59.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"8\">\n<li><span style=\"font-weight: 400;\"> Next, add PHP directives. Use this <\/span><a href=\"https:\/\/www.php.net\/manual\/en\/ini.list.php\"><b>complete list of PHP directives<\/b><\/a><span style=\"font-weight: 400;\"> to guide you. Then, save your edits.<\/span><\/li>\n<li><span style=\"font-weight: 400;\"> In your web browser, open the phpinfo file and look for one of the directives you set. Ensure that the modifications are visible.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">While you can <\/span><b>build custom php.ini files<\/b><span style=\"font-weight: 400;\"> for different directories on your website, you can choose to configure settings in a single php.ini file and then apply it to the entire site.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The following section explores how to do this in a bit.<\/span><\/p>\n<h2><b>How to Modify php.ini Settings on SPanel<\/b><\/h2>\n<p><b>Use these steps to configure php.ini settings:<\/b><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\"> In your SPanel, navigate to the <\/span><b>Tools<\/b><span style=\"font-weight: 400;\"> section<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1332\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1.png\" alt=\"What is php.ini?, How to Modify php.ini Settings on SPanel\" width=\"516\" height=\"279\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1.png 516w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1-300x162.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"2\">\n<li><span style=\"font-weight: 400;\"> Click on <\/span><b>PHP INI Editor<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1339\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image8.png\" alt=\"What is php.ini?, How to Modify php.ini Settings on SPanel 2\" width=\"516\" height=\"279\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image8.png 516w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image8-300x162.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"3\">\n<li><span style=\"font-weight: 400;\"> Choose the desired domain if your account hosts multiple <\/span><b>domains or subdomains.<\/b><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1338\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image7.png\" alt=\"What is php.ini?, How to Modify php.ini Settings on SPanel 3\" width=\"516\" height=\"185\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image7.png 516w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image7-300x108.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"4\">\n<li><span style=\"font-weight: 400;\"> On the Editor page, overwrite custom values for PHP variables listed under <\/span><b>Basic Editor<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1337\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6.png\" alt=\"What is php.ini?, How to Modify php.ini Settings on SPanel 4\" width=\"518\" height=\"617\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6.png 518w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6-252x300.png 252w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ol start=\"5\">\n<li><span style=\"font-weight: 400;\"> Hit<\/span><b> Apply <\/b><span style=\"font-weight: 400;\">to save changes.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">To configure it manually <\/span><i><span style=\"font-weight: 400;\">(from scratch)<\/span><\/i><span style=\"font-weight: 400;\">, click on the <\/span><b>Advanced Editor<\/b><span style=\"font-weight: 400;\">, and enter your PHP directives there.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Keep in mind that if you enter an incorrect <\/span><b>PHP directive or settings,<\/b><span style=\"font-weight: 400;\"> it will affect your website.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Just to be sure, take note of these directives &#8211;\u00a0<\/span><\/p>\n<p><b>Upload_max_filesize <\/b><span style=\"font-weight: 400;\">sets a limit on the maximum file size that can be uploaded via PHP. This choice affects the upload or attachment system of various softwar<\/span><b>e running on your server.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">You should change the value to something a bit higher than the default value. Use a number followed by<\/span><b> M<\/b><span style=\"font-weight: 400;\"> to specify the size in megabytes.<\/span><\/p>\n<p><b>Memory_limit<\/b><span style=\"font-weight: 400;\"> places a limit on how much memory a PHP script can use at a particular time.<\/span><\/p>\n<p><b>Max_execution_time<\/b><span style=\"font-weight: 400;\"> setting prevents the server from being slowed down by poorly written scripts. The value is set to <\/span><b>30 seconds<\/b><span style=\"font-weight: 400;\"> by default; if you increase it too much, your server&#8217;s performance will suffer.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Comparably, <\/span><b>max_input_time<\/b><span style=\"font-weight: 400;\"> limits the amount of time a script can<\/span><b> process data input<\/b><span style=\"font-weight: 400;\">, such as file and forms uploads. The default value is set to<\/span><b> -1,<\/b><span style=\"font-weight: 400;\"> which means the max_execution_time is used instead. Reset the value to <\/span><b>0 <\/b><span style=\"font-weight: 400;\">for unlimited time.<\/span><\/p>\n<p><b>Allow_url_fopen <\/b><span style=\"font-weight: 400;\">allows you to open a <\/span><b>URL<\/b><span style=\"font-weight: 400;\">. It activates the URL-aware fopen wrappers that will enable you to access domain files.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We suggest that you don&#8217;t make any changes to the<\/span><b> advanced settings <\/b><span style=\"font-weight: 400;\">until you&#8217;re sure you\u2019ve got things under wraps.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The php.ini file is the standard configuration file in PHP-based applications. It is used to set upload sizes, display errors, resource limits, file timeouts, and many other things to manage the Apache server. You already have default PHP settings installed on your server. There\u2019s no need to create or edit a php.ini file unless you [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-1331","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=1331"}],"version-history":[{"count":2,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1331\/revisions"}],"predecessor-version":[{"id":4525,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1331\/revisions\/4525"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=1331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=1331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=1331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}