Visual Basic (3539)
How can I create my own php.ini config file?
628 comments. Current rating: (627 votes). Leave comments and/ or rate it.
Question:My system has no php.ini configuration file and thus works with the default settings. How can I create a php.ini file (and where do I need to place it)?
Answer:The location for your config file was set when php was compiled (using directive --with-config-file-path=/directory. The default location on Unix machines is /usr/local/lib/php.ini and on Windows computers it is in the Windows directory e.g. c:\windows\php.ini.
To create a file in that location, take the file php.ini-dist and copy it to the above mentioned location, then rename it to php.ini. Under Windows you could also keep configuration settings in the registry but I recommend using the text file since it makes migrations easier.
Afterwards you can confirm that the php.ini file works by calling phpinfo():