jbille Posted June 27, 2008 Share Posted June 27, 2008 I work on a decent sized system that uses many different mysql connections. The particular page I am concerned with is one which uses many includes. My problem is this, whenever I create a new mysql connection I am getting blank pages when using Firefox, and page cannot be displayed errors when using other browsers (IE and safari). The weird thing about this is that it doesn't happen every time. When I first bring up the page it will be blank or it cannot be displayed. But if I refresh the page will be displayed and the functionality in the page works fine. Sometimes I will have to refresh a couple of times before this happens. Also when I go to the page from a different link in the system it works fine, but not if I type the link directly into the URL bar. I've narrowed the problem down to a single mysql_connect statement, I did this by putting different "die('here')" statements in the script. The particular connection I am referring to is not the one I am using in my new script but one that has been working fine in the current system. However I only get the problem when I create a new connection. I have error_reporting(E_ALL) set in my script and I have checked my Apache logs only to find nothing. Any ideas? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 27, 2008 Share Posted June 27, 2008 If this is on your development system, set error_reporting = E_ALL in your php.ini and set display_errors = On as well (stop and start your web server to get any changes made to php.ini to take effect.) Also, what php version? Php 5.2.4 (if I remember correctly) had a bug where fatal parse and fatal runtime errors would not be displayed when output buffering is on in php.ini. Quote Link to comment Share on other sites More sharing options...
jbille Posted June 27, 2008 Author Share Posted June 27, 2008 error_reporting = E_ALL and display_errors = On in the php.ini file. I am using php 4.3.2. What boggles me is the fact that I am getting a page cannot be displayed in IE and safari, which means to me means there is no error being thrown by PHP. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 27, 2008 Share Posted June 27, 2008 What are the actual runtime values for error_reporting and display_errors using a phpinfo(); statement? You will need to post your code for someone to be able to determine what it is or is not doing. Quote Link to comment Share on other sites More sharing options...
jbille Posted June 27, 2008 Author Share Posted June 27, 2008 error_reporting is "2039", display_errors is "ON". I am unable to change error_reporting in php.ini, but I have used error_reporting(E_ALL) in my script. This is the mysql_connect that is causing the error, however this is inside a DB function I created myself. When I call this function it will successfully make the db connection and won't give any problems until I get to a certain function call: $DB = mysql_connect($Server[$Server]['read'][$Node], $User, $Pass); Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 27, 2008 Share Posted June 27, 2008 Based on the information you have provided in your posts, you likely have a conditional statement that is false and causes nothing to be output or an empty exit/die statement or error_reporting is being turned off in your script after you have set it to E_ALL or sessions are not being started or register_globals are causing variables to be overwritten or you have a same name variable in a program and an include that are overwriting each other or you have made a variable global in a function that is overwriting an incorrect variable or .... You are not really providing us any useful information to help you with your problem, which just makes it take a really long time to guess what the actual problem is. 1001 different people could write code with the symptoms you have described and there could be 1001 different things wrong. The only way you can get specific help with what your code is doing or not doing is to post your code. 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.