Ffile2fix
Sign in Get started

What is a .ini file?

An .ini file is a plain-text configuration file made of [sections] and key=value pairs. Developers meet it as php.ini, my.cnf-style database configs, Windows app and game settings, and desktop.ini folder files.

Key facts

  • There is no single official standard; each program defines its own rules for comments, quoting and duplicate keys.
  • Comments usually start with ; and sometimes #; sections are written in square brackets such as [PHP].
  • Usually served as text/plain; files are small, typically a few KB.
  • PHP reads php.ini once at startup (per PHP-FPM pool or web server process), so edits need a restart or reload.
  • Related formats include .cfg, .conf, .user.ini (per-directory PHP settings) and TOML, which formalises the INI style.

How to open a .ini file

Windows

Right-click and open with Notepad or Notepad++. Files under Program Files may need an editor run as administrator to save.

macOS

Open it with TextEdit (in plain-text mode) or a code editor such as VS Code; use sudo nano for system files in Terminal.

Linux

Edit it with nano or vim, for example sudo nano /etc/php/8.3/fpm/php.ini, and run php --ini to see which php.ini files are loaded.

Common problems and fixes

Changes to php.ini have no effect
You edited a different php.ini from the one in use, or did not restart PHP. Check the 'Loaded Configuration File' line in phpinfo() or php --ini, then restart PHP-FPM or the web server.
"syntax error, unexpected" when PHP parses the file
A value contains characters such as =, ! or quotes that need quoting, or a line is missing its =. Quote the value and fix the line PHP reports.
Setting is ignored because it is commented out
Lines starting with ; are comments, and most default php.ini settings ship commented. Remove the leading semicolon and keep only one active copy of the key.
Program fails after editing in Notepad
The editor may have changed the encoding or line endings. Save as UTF-8 without BOM (or the encoding the program expects) and keep the original line endings.

Often converted to or from: JSON, YAML, TOML, .env

Frequently asked questions

Is it safe to delete an .ini file?

Usually the program recreates a default one, but you lose your custom settings. Back it up first, and do not delete desktop.ini or system configuration files you do not recognise.

Where is php.ini located?

Run php --ini on the command line or check phpinfo() in the browser. The CLI and the web server often use different php.ini files.

What does .user.ini do?

With PHP-FPM or CGI, a .user.ini file in a directory overrides selected PHP settings for that directory. Changes are picked up after user_ini.cache_ttl, which defaults to 300 seconds.

See all file types β†’ Β· Browse error fixes β†’