Jump to content

Blank page in Firefox, Page cannot be displayed (mysql_connect)


jbille

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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.

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.