{"id":151422,"date":"2018-11-16T10:30:16","date_gmt":"2018-11-16T10:30:16","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=151422"},"modified":"2018-11-16T10:32:35","modified_gmt":"2018-11-16T10:32:35","slug":"do-you-know-your-php-ini-file","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/","title":{"rendered":"Do you know your PHP.INI file"},"content":{"rendered":"<p>Hello, Today we are going to learn about that what is the <strong>php.ini<\/strong> file in the <strong>Opencart<\/strong> and how we can change the existing configuration of the server with the help of this file. First of all, we will see what this file is and why we use this.<\/p>\n<p>So <strong>php.ini<\/strong> file also known as &#8220;PHP configuration file&#8221; is the default configuration file which acquires running applications on the server that require PHP. This file is basically used to manage or Customize the variables such as upload sizes, file timeouts, and resource limits which are treated as Configuration variables.<\/p>\n<p>This file always looked up by the server and it will load the all the other desired and required settings whenever PHP server starts up running. Remember if you are making changes in this file and want that your changes in the php.ini file will affect on your server settings then you just need to restart your apache server to apply the changes. And always remember that if you are going to make any changes in the existing php.ini file then it&#8217;s a good idea to copy the original file in some location on your system. This can be useful for the future reference or to easily restore the original file if necessary.<\/p>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Syntax Used inside the file PHP.INI<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<pre class=\"brush:php\">variable_name = \"value\";\u00a0\u00a0\r\n\r\nFor example\r\n\r\nmax_execution_time = 36000;<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>Keys or variable names are case sensitive but not the keyword values. In this file Booleans are be represented by 1\/0, Yes\/No, On\/Off, or True\/False. The lines which are started with a semicolon (;) ignored as these lines are treated as comment lines in this file.<\/p>\n<p>Below are some common variables which are used in the PHP.INI file<\/p>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">register_globals<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<p>register_globals: This is an internal PHP setting which will give access to the all array elements form $_REQUEST variables as register variables. For example, if we have HTML form containing two input fields email and password then when we submit the form than normally we access the variable email like<\/p>\n<pre class=\"brush:php\">$email = $_POST['email']; \/\/for accessing email\r\n &amp;&amp;\r\n$password = $_POST['password'];\/\/for accessing password from the post<\/pre>\n<p>but if register_globals is on then you can access the this with $email &amp;&amp; $password as below<\/p>\n<pre class=\"brush:php\">\/\/ at the very beginning of the script we can use variables like .\r\n$get_email = $email;\r\n$get_password = $password;\r\n\/\/In other words, this expression \r\nif($email === $_POST['email']) {\r\n  return true;\r\n } else {\r\n  return false;\r\n}\r\n\/\/ this will return true.<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>Warning: This feature is DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.<\/p>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">memory Limit<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<p>memory_limit: This variable has the value Max amount of server memory allowed to consume that is used to open a single PHP script.<\/p>\n<pre class=\"brush:php\">memory_limit = 64M; \/\/ value in Mega Bytes<\/pre>\n<p>When script exceeds the memory allowed, the error output looks something like this:<\/p>\n<pre class=\"brush:php\">Fatal error: Allowed memory size of x bytes exhausted (tried to allocate x+y\r\n bytes) in \/path\/to\/php\/your\/running\/script\r\n\r\nor like this:\r\n\r\nPHP Fatal error: Out of memory (allocated x) (tried to allocate x+y bytes)\r\n in \/path\/to\/php\/your\/running\/script<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Upload Max Size &amp;&amp; Post Size<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<p>This are used to control file size limit to users to the maximum upload file size for PHP scripts. Although\u00a0if we want to make a change as per our need we can make it by these two variables\u00a0change the\u00a0<strong>upload_max_filesize<\/strong>and\u00a0<strong>post_max_size<\/strong>\u00a0directives.<\/p>\n<pre class=\"brush:php\">upload_max_filesize = 50M;\r\npost_max_size = 51M;<\/pre>\n<p><strong>Important<\/strong>:\u00a0Always remember that if you want that file uploads to work perfectly, the\u00a0<strong>post_max_size<\/strong>\u00a0directive should be a little larger than the\u00a0<strong>upload_max_filesize<\/strong><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Magic Quotes GPC<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<p>magic_quotes_gpc: This is A Magic Quotes process which is used to escapes incoming data to the PHP script automatically. But this is not the preferred way to code with magic quotes on, instead do it is better to escape the data at runtime, so this one is having the value off.<\/p>\n<pre class=\"brush:php\">magic_quotes_gpc = off;<\/pre>\n<p>Warning: This feature is DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">mysql.connect_timeout<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<p>mysql.connect_timeout: This is to set\u00a0maximum execution time limit for sql query of that you script can take.By default\u00a0which is 30 seconds but we can adjust this y writing as beklow.<\/p>\n<pre class=\"brush:php\">mysql.connect_timeout = 60; \/\/ values in the seconds<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>So here in the above i have mentioned some\u00a0directives used in the PHP.INI file used in the <strong>OPENCART<\/strong> and Almost others CMS too.<\/p>\n<p>Hope you have get the idea of the PHP.INI file. For any query comment in the below.<\/p>\n<p>Happy Learning!!.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, Today we are going to learn about that what is the php.ini file in the Opencart and how we can change the existing configuration of the server with the help of this file. First of all, we will see what this file is and why we use this. So php.ini file also known as <a href=\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":148,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2383,80,305,13],"tags":[7811,2071,2057],"class_list":["post-151422","post","type-post","status-publish","format-standard","hentry","category-blog","category-cms","category-opencart","category-php","tag-ini-php-ini","tag-opencart","tag-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Do you know your PHP.INI file - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Do you know your PHP.INI file - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Hello, Today we are going to learn about that what is the php.ini file in the Opencart and how we can change the existing configuration of the server with the help of this file. First of all, we will see what this file is and why we use this. So php.ini file also known as [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-16T10:30:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-16T10:32:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mangesh Yadav\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mangesh Yadav\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\"},\"author\":{\"name\":\"Mangesh Yadav\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ed1951d709bbfceb1fbf53ae003eac19\"},\"headline\":\"Do you know your PHP.INI file\",\"datePublished\":\"2018-11-16T10:30:16+00:00\",\"dateModified\":\"2018-11-16T10:32:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\"},\"wordCount\":648,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"INI. php.ini\",\"opencart\",\"PHP\"],\"articleSection\":[\"blog\",\"CMS\",\"opencart\",\"php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\",\"url\":\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\",\"name\":\"Do you know your PHP.INI file - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2018-11-16T10:30:16+00:00\",\"dateModified\":\"2018-11-16T10:32:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Do you know your PHP.INI file\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ed1951d709bbfceb1fbf53ae003eac19\",\"name\":\"Mangesh Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/de88cb7793914e715061efdd2f175586c8f16df48f6cf0cf9b12751abf72b1e2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/de88cb7793914e715061efdd2f175586c8f16df48f6cf0cf9b12751abf72b1e2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Mangesh Yadav\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/mangesh-yadav079\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Do you know your PHP.INI file - Webkul Blog","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:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/","og_locale":"en_US","og_type":"article","og_title":"Do you know your PHP.INI file - Webkul Blog","og_description":"Hello, Today we are going to learn about that what is the php.ini file in the Opencart and how we can change the existing configuration of the server with the help of this file. First of all, we will see what this file is and why we use this. So php.ini file also known as [...]","og_url":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-11-16T10:30:16+00:00","article_modified_time":"2018-11-16T10:32:35+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Mangesh Yadav","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Mangesh Yadav","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/"},"author":{"name":"Mangesh Yadav","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ed1951d709bbfceb1fbf53ae003eac19"},"headline":"Do you know your PHP.INI file","datePublished":"2018-11-16T10:30:16+00:00","dateModified":"2018-11-16T10:32:35+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/"},"wordCount":648,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["INI. php.ini","opencart","PHP"],"articleSection":["blog","CMS","opencart","php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/","url":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/","name":"Do you know your PHP.INI file - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2018-11-16T10:30:16+00:00","dateModified":"2018-11-16T10:32:35+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/do-you-know-your-php-ini-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Do you know your PHP.INI file"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ed1951d709bbfceb1fbf53ae003eac19","name":"Mangesh Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/de88cb7793914e715061efdd2f175586c8f16df48f6cf0cf9b12751abf72b1e2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/de88cb7793914e715061efdd2f175586c8f16df48f6cf0cf9b12751abf72b1e2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Mangesh Yadav"},"url":"https:\/\/webkul.com\/blog\/author\/mangesh-yadav079\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/151422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/148"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=151422"}],"version-history":[{"count":6,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/151422\/revisions"}],"predecessor-version":[{"id":151450,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/151422\/revisions\/151450"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=151422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=151422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=151422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}