{"id":6786,"date":"2019-11-13T12:13:09","date_gmt":"2019-11-13T12:13:09","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=6786"},"modified":"2022-02-11T10:47:00","modified_gmt":"2022-02-11T10:47:00","slug":"how-to-control-php-settings-with-a-custom-php-ini-file","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/","title":{"rendered":"How to control PHP settings with a custom php.ini file"},"content":{"rendered":"<p>The article explains how you can use custom php.ini files. This will help to control PHP settings for your web site.<\/p>\n<h3>#Steps to set up a custom PHP.INI file :<\/h3>\n<p>A php.ini file contains directives to control many PHP settings. You may set up one or multiple custom php.ini files to define the working of your website functions. For example, you can have a custom file in your <strong><em>\/home\/username\/public_html<\/em> <\/strong>directory for your website&#8217;s main pages, and also an isolated custom file in your <strong><em>\/home\/username\/public_html\/images<\/em><\/strong> directory for your website&#8217;s image files.<\/p>\n<h3>Perform the following steps to set up a custom php.ini file :<\/h3>\n<p>1. Log in to your <strong>cPanel<\/strong> account.<\/p>\n<p>2. Use the <strong>File Manager<\/strong> and navigate to the directory where you want to modify the behavior of php. By default, a custom php.ini can have its effects only on the directory where it is located.<\/p>\n<p>3. Click on the <strong>File button<\/strong> in the File Manager toolbar to create a new file and name it <strong>php.ini<\/strong>.<\/p>\n<p>4. Click on the new file. After that click on the <strong>Edit button<\/strong> in the File Manager toolbar to edit the new php.ini.<\/p>\n<p>5. Also, add<strong> php directives<\/strong> to the new php.ini and then click on the <strong>Save Changes<\/strong> button.<\/p>\n<p>6. Once you have created the php.ini file and have set its permissions, then you can verify that the configuration is active. To do this, create a <strong>phpinfo<\/strong> <strong>file<\/strong> in the directory where you have created the php.ini.<\/p>\n<p>7. Load the phpinfo file in your web browser, identify one of the directives you have set. Assure that the changes made are visible.<\/p>\n<p>8. You can also create a custom php.ini files for each directory in your website. But, yet many people configure the settings in one php.ini file and then apply it to the entire website. To do so, add the following line to the .htaccess file in your web site&#8217;s document root directory.<\/p>\n<p>Remember to replace username with MilesWeb Hosting username :<\/p>\n<p><strong><em>lsapi_phpini \/home\/username\/public_html\/php.ini<\/em><\/strong><\/p>\n<p>Get more information about the complete list of php.ini directives at :<\/p>\n<p><a href=\"https:\/\/www.php.net\/manual\/en\/ini.list.php\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.php.net\/manual\/en\/ini.list.php<\/a><\/p>\n<p><strong>Also Read :<\/strong><\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/steps-to-create-a-php-redirect\/\" target=\"_blank\" rel=\"noopener\"><strong> Steps to Create a PHP Redirect<\/strong><\/a><\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/a-complete-guide-to-using-phpmyadmin\/\" target=\"_blank\" rel=\"noopener\"><strong> A Complete Guide To Using phpMyAdmin<\/strong><\/a><\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-php-settings-command-line\/\" target=\"_blank\" rel=\"noopener\"><strong> Setting Your PHP Settings in Command Line<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The article explains how you can use custom php.ini files. This will help to control PHP settings for your web site. #Steps to set up a custom PHP.INI file : A php.ini file contains directives to control many PHP settings. You may set up one or multiple custom php.ini files to define the working of [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[1089,1090,1004],"class_list":["post-6786","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-howtos","tag-custom-php-ini-file","tag-php-settings-with-a-custom-php-ini-file","tag-php-ini"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to control PHP settings with a custom php.ini file - Web Hosting FAQs by MilesWeb<\/title>\n<meta name=\"description\" content=\"Learn easy steps to control php settings with a custom php.ini file.\" \/>\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.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to control PHP settings with a custom php.ini file - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"Learn easy steps to control php settings with a custom php.ini file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-13T12:13:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-11T10:47:00+00:00\" \/>\n<meta name=\"author\" content=\"Sonam Wagh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sonam Wagh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/\",\"name\":\"How to control PHP settings with a custom php.ini file - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2019-11-13T12:13:09+00:00\",\"dateModified\":\"2022-02-11T10:47:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"description\":\"Learn easy steps to control php settings with a custom php.ini file.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to control PHP settings with a custom php.ini file\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\",\"name\":\"Sonam Wagh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"caption\":\"Sonam Wagh\"},\"description\":\"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to control PHP settings with a custom php.ini file - Web Hosting FAQs by MilesWeb","description":"Learn easy steps to control php settings with a custom php.ini file.","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.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/","og_locale":"en_GB","og_type":"article","og_title":"How to control PHP settings with a custom php.ini file - Web Hosting FAQs by MilesWeb","og_description":"Learn easy steps to control php settings with a custom php.ini file.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-11-13T12:13:09+00:00","article_modified_time":"2022-02-11T10:47:00+00:00","author":"Sonam Wagh","twitter_misc":{"Written by":"Sonam Wagh","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/","name":"How to control PHP settings with a custom php.ini file - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2019-11-13T12:13:09+00:00","dateModified":"2022-02-11T10:47:00+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"description":"Learn easy steps to control php settings with a custom php.ini file.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-control-php-settings-with-a-custom-php-ini-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to control PHP settings with a custom php.ini file"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4","name":"Sonam Wagh","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","caption":"Sonam Wagh"},"description":"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/"}]}},"views":728,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=6786"}],"version-history":[{"count":2,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6786\/revisions"}],"predecessor-version":[{"id":13236,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6786\/revisions\/13236"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=6786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=6786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=6786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}