INI files Question

0 Brandon Bennett · October 29, 2014
What is an '.ini' file and how does it work?

Post a Reply

Replies

Oldest  Newest  Rating
0 Ron Butcher · October 31, 2014
If you have paid hosting, the php.ini file is already set and you do not have access to it.  It is my understanding though that on some hosts, you can upload a custom php.ini file to the root folder of your hosted site server and it will work.  I believe it works with GoDaddy, but I have never tested it out.  You can also override some settings with a .htaccess file.

http://php.net/manual/en/configuration.changes.php
0 Brandon Bennett · October 31, 2014
okay, thanks! so if i have paid hosting i just upload the php.ini file and my php will work?
0 Ron Butcher · October 31, 2014
When you install PHP, the php.ini file is automatically created and placed.  Where it is placed depends on what OS you are using.  

In my Windows machine it is located at C:\Program Files(x86)\PHP\vX.X\php.ini.

In my Ubuntu machine it is located at \etc\php5\apache2\php.ini

Open up the file with Notepad++ or another text editor.  The file itself has most of the information that you need, it is pretty well laid out and tells you how to make adjustments and what you should set them to.  You can also do a quick Google search for any specific line you need to get more information.
0 Brandon Bennett · October 30, 2014
alright, thank you. how do i go about setting one up?
-2 Ron Butcher · October 30, 2014
An .ini file is a configuration file.  Specifically for PHP, php.ini is the configuration file that holds all of the settings for PHP on the server.  If you are running your own web server, you will be able to adjust the php.ini file to your liking.  If you are using a web host this file is already configured and setup for you.  

There are a ton of things you can adjust and customize for your site.  Such as; error reporting, maximum upload file size, and include folder location.

If you make adjustments to the php.ini file, make a backup first.  You will break PHP if you do not adjust the file correctly, so you will always want a backup handy.  
  • 1

PHP

107,035 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators