robert_gsfame Posted March 1, 2010 Share Posted March 1, 2010 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 Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted March 1, 2010 Share Posted March 1, 2010 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. Quote Link to comment Share on other sites More sharing options...
robert_gsfame Posted March 1, 2010 Author Share Posted March 1, 2010 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 Quote Link to comment Share on other sites More sharing options...
trq Posted March 1, 2010 Share Posted March 1, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.