I'm using XAMPP to develop on my localhost. I would like to remove the PHP notices and keep only the warnings. I know this is done through the php.ini
file, however I'm having trouble locating it. I followed the path in phpinfo()
and it led me to /xampp/php
. Inside this folder are two php.ini
files: one for production and one for development. I have set them both to the error reporting level I'd like, however I still receive notices which makes me believe that neither of these actually control error reporting. I'm using the latest version of XAMPP. So I guess my question is where is the true php.ini
and what are these two other versions?
ini-development contains settings suitable for development environment and php. ini-production contains settings suitable for production environment. As per your requirement, you need take backup of anyone of the file and rename that file to php. ini .
ini file is a special file for PHP. It is where you declare changes to your PHP settings. The server is already configured with standard settings for PHP, which your site will use by default. Unless you need to change one or more settings, there is no need to create or modify a php.
The php. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits.
The PHP configuration file, php. ini, is the final and most immediate way to affect PHP's functionality. The php. ini file is read each time PHP is initialized.in other words, whenever httpd is restarted for the module version or with each script execution for the CGI version.
As of PHP 7 the regular php.ini file was removed and added with php.ini-production and php.ini-devlopment. In PHP's installation text file they state, "We advise you to use php.ini-production, because we optimized the default settings in this file for performance, and security."
So in short use the php.ini-production
First, make sure you're editing php.ini
, not php-development.ini
or php-production.ini
or anything BUT php.ini
. After that, ensure you restart your Apache server or your changes won't take effect.
Also, check out ini_set for setting ini values at runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With