{"id":81338,"date":"2023-03-22T11:59:24","date_gmt":"2023-03-22T11:59:24","guid":{"rendered":"\/tutorials\/?p=81338"},"modified":"2026-03-09T19:18:04","modified_gmt":"2026-03-09T19:18:04","slug":"what-is-php-ini","status":"publish","type":"post","link":"\/ng\/tutorials\/what-is-php-ini\/","title":{"rendered":"What Is PHP.ini File, and Where It\u2019s Located? Understanding Main Parameters and Editing"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p><strong>PHP.ini<\/strong> is a configuration file containing your web server&rsquo;s PHP settings. Every time PHP starts, your system will search for it and run the file to enable your site&rsquo;s scripting rules.<\/p><p>Although it is pre-configured, you may need to change the default PHP settings to suit your needs. For example, you can modify the session cookie&rsquo;s name and lifetime to enable the remember-me feature on your site.<\/p><p>In this article, we will explain the <strong>PHP.ini<\/strong> file location and its important parameters. You will also learn how to edit the file to change your PHP settings.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n<\/div><p>\n\n\n<div class=\"protip\"><div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                   What Is PHP.ini?\n                <\/p>\n            <\/div>\n            <p class=\"protip__content\"><strong>PHP.ini<\/strong> is a configuration file containing your web server&rsquo;s PHP settings. It lets you control your site&rsquo;s PHP-related rules, such as setting the size limit when uploading files and hiding error messages.<br>\n<br>\nThis PHP configuration file location varies depending on the web server. To change its settings, edit the file and change the parameter&rsquo;s value via a text editor.<\/p><\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-where-is-the-php-ini-file-located\">Where Is the PHP.ini File Located<\/h3><p>The <strong>PHP.ini<\/strong> location varies depending on your server, PHP version, and operating system. When running PHP, the system searches for the file in the following places:<\/p><ol class=\"wp-block-list\">\n<li>The <a href=\"https:\/\/docs.php.earth\/php\/sapi\/\">server application programming interface (SAPI)<\/a> module-specific location.<\/li>\n\n\n\n<li>The PHP runtime configuration (PHPRC) environment variable.<\/li>\n\n\n\n<li>Current working directory, searchable using the <a href=\"https:\/\/www.php.net\/manual\/en\/function.getcwd.php\"><strong>getcwd()<\/strong><\/a> function.<\/li>\n\n\n\n<li>The installed PHP or web server&rsquo;s directory.<\/li>\n<\/ol><p>Instead of locating their INI files manually through their hosting&rsquo;s file managers, users can do it automatically.<\/p><p>Among several methods, creating a new PHP file inside your domain&rsquo;s root directory is the easiest. For this tutorial, we will show you how to do it via <a href=\"\/ng\/support\/1583483-comprehensive-guide-to-hpanel-at-hostinger\/\">hPanel<\/a>:<\/p><ol class=\"wp-block-list\">\n<li>Go to <strong>hPanel &rarr; Hosting <\/strong>&rarr; <strong>Manage<\/strong>.<\/li>\n\n\n\n<li>Click <strong>File Manager<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/File-manager-button-in-hPanel.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"482\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/File-manager-button-in-hPanel.png\/w=1024,h=1024,fit=scale-down\" alt=\"File manager button in hPanel\n\" class=\"wp-image-81343\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/File-manager-button-in-hPanel.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/File-manager-button-in-hPanel.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/File-manager-button-in-hPanel.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/File-manager-button-in-hPanel.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Navigate to your site&rsquo;s root directory. In our case, it is <strong>\/home\/username\/public_html<\/strong>.<\/li>\n\n\n\n<li>Select <strong>+ File<\/strong> icon. Enter any filename with a PHP extension, such as <strong>phpinfo.php<\/strong>. Then, click <strong>Create New File<\/strong>.<\/li>\n\n\n\n<li>Right-click the new file &rarr; <strong>Edit<\/strong>, and<strong> <\/strong>enter the following code:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n   phpinfo();\n?&gt;<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Click <strong>Save Changes.<\/strong><\/li>\n\n\n\n<li>Enter <strong>yourdomain.tld\/phpinfo.php <\/strong>on your web browser and hit enter.<\/li>\n\n\n\n<li>Search for the <strong>Loaded configuration file<\/strong>. The <strong>PHP.ini <\/strong>path should look like this:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP.ini-location-in-PHP-info-output.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1460\" height=\"248\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP.ini-location-in-PHP-info-output.png\/w=1024,h=1024,fit=scale-down\" alt=\"PHP.ini location in PHP info output\n\" class=\"wp-image-81344\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP.ini-location-in-PHP-info-output.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP.ini-location-in-PHP-info-output.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP.ini-location-in-PHP-info-output.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP.ini-location-in-PHP-info-output.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP.ini-location-in-PHP-info-output.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1460px) 100vw, 1460px\" \/><\/a><\/figure><\/div><p>This method also works in cPanel to locate the <strong>PHP.ini <\/strong>file of a virtual private server (<a href=\"\/ng\/vps-hosting\">VPS<\/a>). Alternatively, <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583245-how-to-connect-to-your-account-via-ssh\">connect using SSH<\/a> and execute the following command:<\/p><pre class=\"wp-block-preformatted\">php -i | grep 'Configuration File'<\/pre><p>Your SSH client will output the directory, which is <strong>usr\/local\/lib <\/strong>for most web servers. In addition to querying the location, you can move and edit the<strong> PHP.ini <\/strong>file with the SSH client.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Learn More about VPS and Linux Commands                <\/p>\n            <\/div>\n            <p class=\"protip__content\"><br>\n<a href=\"\/ng\/tutorials\/what-is-vps-hosting\/\">What is VPS Hosting<\/a><br>\n<a href=\"\/ng\/tutorials\/linux-commands\/\">40 Essential Linux Commands That Every User Should Know<\/a><\/p>\n                    <\/div>\n        \n\n\n\n<\/p><p>Note that the <strong>PHP.ini<\/strong> file is usually inaccessible for shared hosting users. In this case, use the hosting control panel&rsquo;s configuration menu or <a href=\"\/ng\/tutorials\/locate-and-create-htaccess\/\">edit the <strong>.htaccess<\/strong> file<\/a> to change PHP settings.<\/p><h2 class=\"wp-block-heading\" id=\"h-important-parameters-of-the-php-ini-file\">Important Parameters of the PHP.ini File<\/h2><p>In this section, we will explain the most important parameters in the <strong>PHP.ini<\/strong> file, including their values and purposes. These parameters are also known as <strong>directives<\/strong>.<\/p><p><div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Some parameters and values may be unavailable on certain PHP versions. Refer to the full <a href=\"https:\/\/www.php.net\/manual\/en\/ini.list.php\">PHP.ini directive list<\/a> to learn more about the changes.\n            <\/p><\/div>\n\n\n\n<\/p><p><strong>display_errors<\/strong><\/p><p>Determine if PHP error messages are displayed to users during script execution or not using the <strong>on <\/strong>and <strong>off <\/strong>value. Due to security reasons, you should use this directive only when developing your site.<\/p><p><strong>error_reporting<\/strong><\/p><p>Set which error message is displayed to users when <strong>display_errors <\/strong>is enabled. The <strong>error_reporting <\/strong>parameter takes several <a href=\"https:\/\/www.php.net\/manual\/en\/errorfunc.constants.php\">constants to display different errors<\/a>.<\/p><p>You may use multiple constants and exclude specific errors. For instance, to show all errors but the deprecation warning, use the following:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">E_ALL &amp;amp; ~E_DEPRECATED<\/pre><p><strong>error_log<\/strong><\/p><p>Specify the file where PHP will log errors for error troubleshooting. Before enabling it, ensure the web server&rsquo;s users have permission to write the file.<\/p><p><strong>file_uploads<\/strong><\/p><p>Set whether the HTTP file uploads are enabled or not. The <strong>on <\/strong>value will allow users to upload files to your site, while <strong>off <\/strong>disables it.<\/p><p><strong>upload_max_filesize<\/strong><\/p><p>This parameter determines the <a href=\"\/ng\/tutorials\/php-maximum-upload-size\/\">maximum uploaded file size PHP allows<\/a> on your site. Since the default value is <strong>2 MB<\/strong>, you can <a href=\"\/ng\/tutorials\/how-to-increase-the-maximum-file-upload-size-in-wordpress\/\">increase the maximum upload file size<\/a> limit to enable users to upload large files.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Suggested Reading                <\/p>\n            <\/div>\n            <p class=\"protip__content\"> Check out this tutorial on how to <a href=\"\/ng\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress\/\">fix the upload_max_filesize issue<\/a> in case of an error.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><p><strong>post_max_size<\/strong><\/p><p>The maximum POST data size PHP can collect from HTML forms on your site. The value should be larger than the maximum file size, as it is handled with the <a href=\"https:\/\/www.w3schools.com\/php\/php_superglobals_post.asp\">POST function<\/a>.<\/p><p><strong>allow_url_fopen<\/strong><\/p><p>Write a PHP script to access remote files from another server. It is <strong>off <\/strong>by default, as enabling it may expose your server to a code injection attack.<\/p><p><strong>allow_url_include<\/strong><\/p><p>This directive has a similar function as <strong>allow_url_open<\/strong>, but uses the<strong> <\/strong><a href=\"https:\/\/www.w3schools.com\/php\/php_includes.asp\">include<strong> <\/strong>function<\/a>. To enable it, <strong>allow_url_open <\/strong>must be set to <strong>on<\/strong>.<\/p><p><strong>session.name<\/strong><\/p><p>This directive sets the current session&rsquo;s name used in cookies and URLs. You may change the default <strong>PHPSESSID<\/strong> value to any descriptive name with alphanumeric characters.<\/p><p><strong>session.auto_start<\/strong><\/p><p>Choose whether a PHP session starts automatically or on request when users access your site. If you set the value to <strong>0, <\/strong>the session will start manually using the <strong>session_start <\/strong>script.<\/p><p><strong>session.cookie_lifetime<\/strong><\/p><p>Specify a session cookie&rsquo;s lifetime in your site&rsquo;s visitors&rsquo; browsers. By default, the value is set to <strong>0 <\/strong>seconds, meaning your site erases visitors&rsquo; session data after they close their browsers.<\/p><p><strong>memory_limit<\/strong><\/p><p>Set the maximum amount of RAM a PHP script can use. Be careful when increasing the memory limit, as wrong configurations may lead to slow sites or server outages.<\/p><p><strong>max_execution_time<\/strong><\/p><p>Determine a script&rsquo;s maximum running time. You can change the default 30-second maximum execution time to any value, but setting it too high might cause performance issues.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Suggested Reading                <\/p>\n            <\/div>\n            <p class=\"protip__content\"> Refer to our guide on how to <a href=\"\/ng\/tutorials\/how-to-fix-maximum-execution-time-exceeded-error-wordpress\/\"> fix Fatal Error: max_execution_time exceeded<\/a> if you get this error code.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><p><strong>max_input_time<\/strong><\/p><p>Set how long a script can parse data collected from HTML forms on your site using a POST or <a href=\"https:\/\/www.w3schools.com\/php\/php_superglobals_get.asp\">GET method<\/a>. The more data your site collects, the higher the <strong>max_input_time <\/strong>value should be.<\/p><p><strong>upload_temp_dir<\/strong><\/p><p>Specify the temporary directory for storing uploaded files. All users should be able to write in the specified directory, or PHP will use the system&rsquo;s default.<\/p><p><strong>realpath_cache_ttl<\/strong><\/p><p>Set the duration for your system to cache the <a href=\"https:\/\/www.geeksforgeeks.org\/php-realpath-function\/\">realpath<\/a> information. We recommend increasing the value for systems with rarely changing files.<\/p><p><strong>arg_separator.output<\/strong><\/p><p>Use this data-handling directive to separate arguments in PHP-generated URLs. Its default value is an ampersand (<strong>&amp;<\/strong>).<\/p><p><strong>arg_separator.output<\/strong><\/p><p>Set the separator PHP uses to parse input URLs into variables. By default, it is an ampersand, but you can change it into other symbols like semicolons.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-edit-the-php-ini-file\">How to Edit the PHP.ini File<\/h2><p>Before you edit the<strong> PHP.ini<\/strong> file, check your server&rsquo;s PHP configuration using <strong>phpinfo.php<\/strong>. If configured as an Apache module, change the PHP setting <a href=\"https:\/\/www.php.net\/manual\/en\/configuration.file.per-user.php\">using your <strong>.htaccess <\/strong>file<\/a>.<\/p><p><div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Create a backup of your <strong>PHP.ini<\/strong> file before editing. It lets you quickly restore the file, as misconfigurations may result in performance issues or downtime.\n            <\/p><\/div>\n\n\n\n<\/p><p>For PHP CGI, directly edit the INI file using cPanel&rsquo;s <a href=\"https:\/\/docs.cpanel.net\/cpanel\/software\/multiphp-ini-editor-for-cpanel\/\"><strong>MultiPHP INI Editor<\/strong><\/a><strong> <\/strong>to configure the settings.<\/p><p>If you are using hPanel, simply download and edit the file using a text editor.<\/p><p>For cPanel users, here are the steps to do it:<\/p><ol class=\"wp-block-list\">\n<li>Access your <strong>cPanel<\/strong>.<\/li>\n\n\n\n<li>Go to the <strong>Software <\/strong>section &rarr; <strong>MultiPHP INI editor<\/strong>.<\/li>\n\n\n\n<li>Click the <strong>Basic Mode <\/strong>tab. For in-depth customization, select <strong>Editor Mode <\/strong>instead.<\/li>\n\n\n\n<li>From the drop-down menu, select the <strong>home directory <\/strong>or <strong>domain path<\/strong>. The latter will configure your domain-specific <strong>PHP.ini file<\/strong>.<\/li>\n\n\n\n<li>Change the settings for each PHP directive and click <strong>Apply <\/strong>to save the changes.<\/li>\n<\/ol><p>If your server doesn&rsquo;t support the editor tool, use the <strong>PHP selector<\/strong> instead. Alternatively, download the <strong>PHP.ini <\/strong>file and change the configuration directives using a text editor.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP-Selector_s-configuration-menu-in-cPanel.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1460\" height=\"658\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP-Selector_s-configuration-menu-in-cPanel.png\/w=1024,h=1024,fit=scale-down\" alt=\"PHP Selector's configuration menu in cPanel\n\" class=\"wp-image-81345\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP-Selector_s-configuration-menu-in-cPanel.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP-Selector_s-configuration-menu-in-cPanel.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP-Selector_s-configuration-menu-in-cPanel.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP-Selector_s-configuration-menu-in-cPanel.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/PHP-Selector_s-configuration-menu-in-cPanel.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1460px) 100vw, 1460px\" \/><\/a><\/figure><\/div><p>For VPS users, configure PHP settings via SSH client. Ensure you have <a href=\"\/ng\/tutorials\/how-to-install-and-use-nano-text-editor\/\">installed the Nano text editor<\/a> and execute this<strong> <\/strong>command:<\/p><pre class=\"wp-block-preformatted\">nano usr\/local\/lib\/php.ini<\/pre><p>Change the directory with your <strong>PHP.ini<\/strong> file path in your VPS.<\/p><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-vps-hosting\" href=\"\/ng\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p><strong>PHP.ini<\/strong> is a configuration file that stores your web server&rsquo;s PHP settings. You may edit it to change your site&rsquo;s PHP-related rules, like restricting actions or limiting the uploaded data size.<\/p><p>Since its location varies, create a PHP info file in your domain&rsquo;s root directory and load it in your browser to quickly find <strong>PHP.ini<\/strong>. On the PHP info, the location is in the <strong>loaded configuration file<\/strong> section.<\/p><p><strong>PHP.ini <\/strong>file contains several parameters to set error handling, file uploads, session configuration, and other rules. To change the settings, edit the respective parameters&rsquo; values.<\/p><p>Hostinger&rsquo;s hPanel users can just download the file and change the parameters in a text editor. Should you have any more questions, leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP.ini is a configuration file containing your web server&rsquo;s PHP settings. Every time PHP starts, your system will search for it and run the file to enable your site&rsquo;s scripting rules. Although it is pre-configured, you may need to change the default PHP settings to suit your needs. For example, you can modify the session [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/what-is-php-ini\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"What Is PHP.ini File, Main Parameters + How to Edit It","rank_math_description":"The php.ini file is the default configuration file for running PHP applications. Check this article to learn more about the php.ini file.","rank_math_focus_keyword":"php.ini","footnotes":""},"categories":[22644],"tags":[],"class_list":["post-81338","post","type-post","status-publish","format-standard","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/what-is-php-ini","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/que-es-php-ini","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/file-php-ini","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/what-is-php-ini","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/what-is-php-ini\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/what-is-php-ini\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/que-es-php-ini","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/que-es-php-ini","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/que-es-php-ini","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/what-is-php-ini","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/what-is-php-ini","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/what-is-php-ini","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/what-is-php-ini","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/81338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=81338"}],"version-history":[{"count":14,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/81338\/revisions"}],"predecessor-version":[{"id":144143,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/81338\/revisions\/144143"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=81338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=81338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=81338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}