Jump to content

what is php.ini ??


robert_gsfame

Recommended Posts

Yesterday i found problems in my website which never occured before.. I had this warning :"Cannot modify header blablabla", but i really didn't get the clue as i have checked all of my scripts and no white space left before or after i set the session

 

Just to tell you guys, that i didn't get this problem within 8 months until last night. Then i put php.ini inside my root folder and the problem solved

 

I just wanna ask what is php.ini actually for??  Why should i have it?? why do the same problem never occured when running the website in local server although i dont have php.ini??

 

thx for brief explanation

 

 

 

 

Link to comment
Share on other sites

php.ini is basically the configuration file for PHP, and if you read the first few lines in it, it'll give you a nice description of what it is:

 

This file controls many aspects of PHP's behavior.  In order for PHP to read it, it must be named 'php.ini'.  PHP looks for it in the current working directory, in the path designated by the environment variable PHPRC, and in the path that was defined in compile time (in that order).

 

What you've done, by the sounds of it, is uploaded your version of php.ini from your local machine, into your root directory. So now it is loading the settings from your php.ini, and if you looked in your php.ini file for "Error handling and logging" you would come to the "Error handling and logging" section.

 

This section controls all errors and warnings that are displayed and logged. I'm taking a stab here that your php.ini file has it set as this:

 

error_reporting = E_ALL & ~E_WARNING

 

Or something along those lines.

 

When developing PHP scripts, you should be showing all errors, so you can see everything that is happening. If you're getting a Header Warning, something is obviously up and you shouldn't be ignoring it.

 

Link to comment
Share on other sites

In order to solve the problem regarding this error :"CANNOT MODIFY HEADER"

i put session.auto_start = off inside php.ini

 

Anyway i just talked to a programmer and he said that i should stored php.ini if the default setting of the server is not supporting that

 

Is that true?? Then where can i find php.ini in my local server so that error will not occur when running the site..which folder?? i use dreamweaver anyway

 

Link to comment
Share on other sites

Then where can i find php.ini in my local server so that error will not occur when running the site..which folder?? i use dreamweaver anyway

 

That would completely depend on your OS and how php was installed. Nothing to do with dreamweaver. if you make a simple phpinfo script it will tell you where your ini is located.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.