{"id":2733,"date":"2017-10-06T07:40:14","date_gmt":"2017-10-06T11:40:14","guid":{"rendered":"https:\/\/www.pair.com\/support\/kb\/?p=2733"},"modified":"2019-02-05T09:25:58","modified_gmt":"2019-02-05T14:25:58","slug":"php-ini-vs-user-ini","status":"publish","type":"ht_kb","link":"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/","title":{"rendered":"php.ini vs user.ini"},"content":{"rendered":"<p class=\"p1\"><span class=\"s1\"><a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/shared-hosting\/\"><p style=\"background-color:#1a3d6e !important;color:#fff;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">Shared<\/p><\/a> <a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/vps\/\"><p style=\"background-color:#1a3d6e !important;color:#fff;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">VPS<\/p><\/a> <a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/qs-dedicated\/\"><p style=\"background-color:#1a3d6e !important;color:#fff;padding:6px; display:inline-block!important;font-size:12px; font-weight:bold; border-radius:3px;\">Dedicated<\/p><\/a><\/span><\/p>\n<h3>What is <span style=\"font-family: monospace;\">php.ini<\/span>?<\/h3>\n<p><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> is a file that allows you to control your PHP settings on your server. When your PHP starts, it will consult your <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> files to see how PHP settings should be configured. So, naturally, if you make changes to the <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> file, you may have to restart your PHP processes to see those changes go into effect.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The <span style=\"font-family: monospace;\">php.ini<\/span> file can be used in many ways, some of which include:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>upload_max_filesize<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Limiting the maximum file size that can be uploaded<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>max_file_uploads<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Limiting the maximum number of files that can be uploaded at the same time<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>max_execution_time<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Limiting the maximum time a script can run before it\u2019s terminate<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> uses commands called \u201cdirectives\u201d to communicate with the server. You can find a <\/span><a href=\"http:\/\/php.net\/manual\/en\/ini.list.php\"><span style=\"font-weight: 400;\">list of <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> directives<\/span><\/a><span style=\"font-weight: 400;\"> on the PHP documentation site. Make sure you check the \u201cmodes\u201d of the directives so you know they are compatible with the <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> file. \u00a0Modes are really just categories that help you figure out which directives can be used in certain PHP files. If you refer to the PHP documentation site\u2019s list of <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> directives, you will see that each directive has a mode associated with it. These modes are listed in the <\/span><b>Changeable <\/b><span style=\"font-weight: 400;\">column.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Optionally, you can also group <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> directives together into \u201csections.\u201d While this does not immediately affect your PHP, it can be used to group directives together and apply them to specific hosts or paths. Check out the<\/span><a href=\"http:\/\/php.net\/manual\/en\/ini.sections.php\"><span style=\"font-weight: 400;\"> list of <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> sections<\/span><\/a><span style=\"font-weight: 400;\"> on the PHP documentation site. \u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><span style=\"font-weight: 400; font-family: monospace;\">php.ini<\/span><span style=\"font-weight: 400;\"> file has a blanket effect. How it\u2019s configured will dictate how all your server directories are configured. However, if you want to make an exception for a directory, you would use a <\/span><span style=\"font-weight: 400; font-family: monospace;\">.user.ini <\/span><span style=\"font-weight: 400;\">file.<\/span><\/p>\n<h3>What is <span style=\"font-family: monospace;\">.user.ini<\/span>?<\/h3>\n<p><span style=\"font-weight: 400; font-family: monospace;\">.user.ini<\/span><span style=\"font-weight: 400;\"> file controls the PHP settings of a single directory. It will only affect the directory it is in. However, each directory may have a <\/span><span style=\"font-weight: 400; font-family: monospace;\">user.ini<\/span><span style=\"font-weight: 400;\"> file.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are only certain directives allowed for use in a<\/span><span style=\"font-weight: 400; font-family: monospace;\"> .user.ini<\/span><span style=\"font-weight: 400;\"> file. The allowed directories belong to the <\/span><span style=\"font-weight: 400; font-family: monospace;\">php_ini_perdir <\/span><span style=\"font-weight: 400;\">and <\/span><span style=\"font-weight: 400; font-family: monospace;\">php_ini_user<\/span><span style=\"font-weight: 400;\"> modes. Be sure to check the <\/span><b>Changeable<\/b><span style=\"font-weight: 400;\"> column of the<\/span><a href=\"http:\/\/php.net\/manual\/en\/ini.list.php\"><span style=\"font-weight: 400;\"><span style=\"font-family: monospace;\"> php.ini<\/span> directives list <\/span><\/a><span style=\"font-weight: 400;\">to see if the directive is usable with the <\/span><span style=\"font-weight: 400; font-family: monospace;\">.user.ini <\/span><span style=\"font-weight: 400;\">file.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">One directive to keep in mind is the <\/span><span style=\"font-family: monospace;\">user_ini.filename_ttl<\/span><span style=\"font-weight: 400;\">. This directive establishes how often the <\/span><span style=\"font-weight: 400; font-family: monospace;\">.user.ini<\/span><span style=\"font-weight: 400;\"> file is checked for changes. Depending on what frequency this directive is set to, changes to PHP may experience a slight delay before being implemented. <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is php.ini? php.ini is a file that allows you to control your PHP settings on your server. When your PHP starts, it will consult your php.ini files to see how PHP settings should be configured. So, naturally, if you make changes to the php.ini file, you may have to&#8230;<\/p>\n","protected":false},"author":11,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[175],"ht-kb-tag":[178,176,177],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>php.ini vs user.ini - Knowledge Base - Pair Networks<\/title>\n<meta name=\"description\" content=\"php.ini and user.ini are files that are used to control your directories. The php.ini file is a file that allows you to control your PHP settings on your server. The .user.ini file controls the PHP settings of a single directory. It will only affect the directory it is in.\" \/>\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.pair.com\/support\/kb\/php-ini-vs-user-ini\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"php.ini vs user.ini - Knowledge Base - Pair Networks\" \/>\n<meta property=\"og:description\" content=\"php.ini and user.ini are files that are used to control your directories. The php.ini file is a file that allows you to control your PHP settings on your server. The .user.ini file controls the PHP settings of a single directory. It will only affect the directory it is in.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - Pair Networks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pairnetworks\/\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-05T14:25:58+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@pairNetworks\" \/>\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:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/\",\"name\":\"php.ini vs user.ini - Knowledge Base - Pair Networks\",\"isPartOf\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#website\"},\"datePublished\":\"2017-10-06T11:40:14+00:00\",\"dateModified\":\"2019-02-05T14:25:58+00:00\",\"description\":\"php.ini and user.ini are files that are used to control your directories. The php.ini file is a file that allows you to control your PHP settings on your server. The .user.ini file controls the PHP settings of a single directory. It will only affect the directory it is in.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pair.com\/support\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"php.ini vs user.ini\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#website\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/\",\"name\":\"Knowledge Base - Pair Networks\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pair.com\/support\/kb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#organization\",\"name\":\"Pair Networks\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg\",\"contentUrl\":\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg\",\"width\":360,\"height\":360,\"caption\":\"Pair Networks\"},\"image\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pairnetworks\/\",\"https:\/\/twitter.com\/pairNetworks\",\"https:\/\/www.instagram.com\/pairnetworks\/\",\"https:\/\/www.linkedin.com\/company\/2269676\/\",\"https:\/\/www.pinterest.com\/pairnetworksinc\/pins\/\",\"https:\/\/www.youtube.com\/user\/pairnetworks\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"php.ini vs user.ini - Knowledge Base - Pair Networks","description":"php.ini and user.ini are files that are used to control your directories. The php.ini file is a file that allows you to control your PHP settings on your server. The .user.ini file controls the PHP settings of a single directory. It will only affect the directory it is in.","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.pair.com\/support\/kb\/php-ini-vs-user-ini\/","og_locale":"en_US","og_type":"article","og_title":"php.ini vs user.ini - Knowledge Base - Pair Networks","og_description":"php.ini and user.ini are files that are used to control your directories. The php.ini file is a file that allows you to control your PHP settings on your server. The .user.ini file controls the PHP settings of a single directory. It will only affect the directory it is in.","og_url":"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/","og_site_name":"Knowledge Base - Pair Networks","article_publisher":"https:\/\/www.facebook.com\/pairnetworks\/","article_modified_time":"2019-02-05T14:25:58+00:00","twitter_card":"summary_large_image","twitter_site":"@pairNetworks","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/","url":"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/","name":"php.ini vs user.ini - Knowledge Base - Pair Networks","isPartOf":{"@id":"https:\/\/www.pair.com\/support\/kb\/#website"},"datePublished":"2017-10-06T11:40:14+00:00","dateModified":"2019-02-05T14:25:58+00:00","description":"php.ini and user.ini are files that are used to control your directories. The php.ini file is a file that allows you to control your PHP settings on your server. The .user.ini file controls the PHP settings of a single directory. It will only affect the directory it is in.","breadcrumb":{"@id":"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pair.com\/support\/kb\/php-ini-vs-user-ini\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pair.com\/support\/kb\/"},{"@type":"ListItem","position":2,"name":"php.ini vs user.ini"}]},{"@type":"WebSite","@id":"https:\/\/www.pair.com\/support\/kb\/#website","url":"https:\/\/www.pair.com\/support\/kb\/","name":"Knowledge Base - Pair Networks","description":"","publisher":{"@id":"https:\/\/www.pair.com\/support\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pair.com\/support\/kb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pair.com\/support\/kb\/#organization","name":"Pair Networks","url":"https:\/\/www.pair.com\/support\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg","contentUrl":"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg","width":360,"height":360,"caption":"Pair Networks"},"image":{"@id":"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pairnetworks\/","https:\/\/twitter.com\/pairNetworks","https:\/\/www.instagram.com\/pairnetworks\/","https:\/\/www.linkedin.com\/company\/2269676\/","https:\/\/www.pinterest.com\/pairnetworksinc\/pins\/","https:\/\/www.youtube.com\/user\/pairnetworks"]}]}},"_links":{"self":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/2733"}],"collection":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/comments?post=2733"}],"version-history":[{"count":5,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/2733\/revisions"}],"predecessor-version":[{"id":6361,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/2733\/revisions\/6361"}],"wp:attachment":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/media?parent=2733"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=2733"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=2733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}