user780483
user780483

Reputation: 3063

Php.ini production vs development

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?

Upvotes: 32

Views: 101306

Answers (9)

Aditya Chaturvedi
Aditya Chaturvedi

Reputation: 151

I downloaded php-8.1.0 from official website. php.ini or configuration settings file is not present in it. Instead it has been replaced by two files i.e. php.ini-development and php.ini-production.

My requirement was to edit the php.ini file in order to enable pgsql extension. Alas! there were not one but two .ini files. Being new to php, I made changes to both the files but it didn't worked.

After doing some research, I came to know that in the recent versions of php (not sure from which), user is provided with two .ini files. As name suggests, php.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. In this file you will need make required changes for your php environment.

If you compare the two files using tools such as diff-merge, you will get more in-depth understanding.

Upvotes: 8

Jason
Jason

Reputation: 79

My issue is that I was editing the php.ini-production and overlooked the standard php.ini file.

I edited the php.ini file by adding extension=php_odbc.dll and it fixed the error.

Upvotes: 0

Sumit Nath
Sumit Nath

Reputation: 1

The PHP.ini file is still there, only it doesn't include the extension .ini, the extension has been removed. You will notice two file name php, one is application file another is configuration setting when you open configuration setting in notepad you will notice that it has ini extension. so the php configuration file is ini file.

Upvotes: -2

Sumit Nath
Sumit Nath

Reputation: 1

PHP 5.3.0 has significantly improved performance and parsing of INI files, and adds several new syntax features.

The standard php.ini files have been re-organized and renamed. php.ini-development contains settings recommended for use in development environments. php.ini-production contains settings recommended for use in production environments

Upvotes: -2

Dalton
Dalton

Reputation: 455

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

Upvotes: 43

Statman
Statman

Reputation: 33

php.ini.development and php.ini.production are entirely different from php.ini. the problem is that in the php folder the required php.ini is not marked along with its extension ( .php). Only php is written.Check the properties of the file 'php' of "*configuration settings*" type.it must be .ini,This is the exact file which manages error reporting.

Upvotes: 2

Charles Sprayberry
Charles Sprayberry

Reputation: 7853

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.

Upvotes: 19

Jaminyah
Jaminyah

Reputation: 1

In XAMPP version 1.8.1 php.ini file located at \xampp\php\php.ini modify line 922 upload_max_filesize = 2M Note: 2M means 2MB, so change to 10M for 10MB file upload. Also note that php.ini-development and php.ini-production are different files from php.ini.

Upvotes: 0

gray
gray

Reputation: 1018

I had this confusion, in my computer, the php.ini file didn't appear with the .ini extension name visible - it was just php , and in the type column, it has the value 'configuration settings'

Upvotes: 7

Related Questions