Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php.ini production vs development

Tags:

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?

like image 930
user780483 Avatar asked Jul 30 '11 02:07

user780483


People also ask

What is the difference between PHP ini development and PHP ini production?

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 .

Do I need a 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.

What is the purpose of PHP ini file?

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.

How does PHP ini work?

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.


2 Answers

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

like image 187
Dalton Avatar answered Sep 22 '22 18:09

Dalton


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.

like image 25
Charles Sprayberry Avatar answered Sep 24 '22 18:09

Charles Sprayberry