dellvostro Posted September 11, 2008 Share Posted September 11, 2008 Im getting the following error for a formmailer from one of my sites. I tested on multiple other hosting servers and I have no notices, errors or problems. This leads me to believe its a hosting issue. Can anyone confirm or advise on how to fix or even suppress or hide notice? Thank you Notice: A session had already been started - ignoring session_start() in /var/www/vhosts/mydomain/httpdocs/formmailer.php on line 1 Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 11, 2008 Share Posted September 11, 2008 http://www.google.com/search?client=safari&rls=en-us&q=php+suppress+or+hide+notice&ie=UTF-8&oe=UTF-8 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 11, 2008 Share Posted September 11, 2008 The truth of the matter is it takes php 10 to 20 times longer to execute a line of code that generates a notice, warning, or fatal error. Suppressing the reporting or display of the error simply masks the problem. It is always best to find and fix the problem instead of trying to fix a symptom. Either your code has more than one session_start() and the error reporting on the servers where it seems to work is set to hide the error message or your code only has one session_start() it would mean that php is setup to automatically start the session on the server where you are getting the error message. For the first possibility, make sure your code only has one session_start() per page (any page that uses sessions should have a single session_start() at the beginning of the page.) For the second possibility, use a phpinfo() statement and check what session.auto_start is set to? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 11, 2008 Share Posted September 11, 2008 The truth of the matter is it takes php 10 to 20 times longer to execute a line of code that generates a notice, warning, or fatal error. i didn't know this. thanks for the info! Quote Link to comment Share on other sites More sharing options...
dellvostro Posted September 12, 2008 Author Share Posted September 12, 2008 I ran the phpinfo and heres the only session.auto I found. If the values are incorrect, how would I change them? I only have 1 session_start at top of document page. There is a phpdigs java script calling a search box function on page, but I dont see a session_start on this page. Directive Local Value Master Value session.auto_start Off Off Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 14, 2008 Share Posted September 14, 2008 The auto start setting being off means that php is not causing the error. Which means that your code is executing a session_start() more than once. You either have something in a loop or a file is being include more than once... Is the formmailer.php script the target of a form or are you including it into some other file? Was the script with the phpinfo() statement in the same folder where the script generating the error is located (there might be a .htaccess or local php.ini file changing the auto start setting.) There could also be an auto_prepend_file that could be starting the session (some hosts do some unusual things.) What does your phpinfo() show for the auto_prepend_file setting? Quote Link to comment Share on other sites More sharing options...
dellvostro Posted September 14, 2008 Author Share Posted September 14, 2008 auto_prepend_file no value no value i tried using the @ in session_start but ut didint hie notice. It really baffles me that the form works on a half dozen other servers, but the one I have no control over it doesnt work . 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.