#48233 [Bgs]: The Page Cannot Be Displayed

From: Date: Mon, 11 May 2009 17:27:21 +0000
Subject: #48233 [Bgs]: The Page Cannot Be Displayed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137170@lists.php.net to get a copy of this message
ID: 48233 User updated by: ralphyz at gmail dot com Reported By: ralphyz at gmail dot com Status: Bogus Bug Type: IIS related Operating System: W2K3 SP2 PHP Version: 5.2.9 New Comment: Reinstalled PHP 5.2.9 - everything is working now. Previous Comments: ------------------------------------------------------------------------ [2009-05-11 15:10:46] ralphyz at gmail dot com Turning off "Show friendly HTTP error messages" in IE now gives me the Access Violation error message instead of "The page cannot be displayed." ------------------------------------------------------------------------ [2009-05-11 14:50:33] ralphyz at gmail dot com When I access the same page from Firefox, I get an Access Violation error - but again, only when all three lines are uncommented. ------------------------------------------------------------------------ [2009-05-11 14:36:49] ralphyz at gmail dot com There are no errors in the log file. The following lines: print ("id: $id <BR>"); print ("name:" . $name . "<BR>"); print ("description:" . $description . "<BR>"); All work individually (two others are commented out), or in pairs (one other is commented out). I get the error when all three are active (none of the three commented out). They also work if I do this: print ("id: $id <BR>name: $name<BR>description: $description"); It just won't work if I have three separate lines. No other code gives me an error. ------------------------------------------------------------------------ [2009-05-11 14:14:08] johannes@php.net When using the mysqli extension together with the mysql extension you have to use the same libraries and include files. mysqli extension requires the location of mysql_config file, mysql extension requires the path of your mysql installation. If you installed MySQL 4.1 for example with prefix /usr/local/mysql-4.1 your configure settings should be --with-mysql=/usr/local/mysql-4.1 --with-mysqli=/usr/local/mysql-4.1/bin/mysql_config I case that is correct please check your log files for more verbose error messages. ------------------------------------------------------------------------ [2009-05-11 14:08:54] ralphyz at gmail dot com Description: ------------ I get "The Page Cannot Be Displayed" error message when there are 3 print statements in a row which display the contents of an array (which only has 1 column, and 3 rows). When I comment out any of the three print statements, the page displays without a problem. I tested this code on Ubuntu - and it works without a problem. Also commenting out any of the following three lines makes this work without a problem: print ("id: $id <BR>"); print ("name:" . $name . "<BR>"); print ("description:" . $description . "<BR>"); If I comment out any of those lines, but replace the "IF" statement with a "FOR" statement to run through all my records ($num_rows = 31), I get the same error (The Page Cannot Be Displayed). The print statements with "got here" in them seem to have no negative effect on the script. Reproduce code: --------------- <?php $DBHost = "x.x.x.x"; // IP-address of MySQL server $DBLogin = "username"; // Username of MySQL user $DBPassword = "password"; // Password of MySQL user $DBDatabase = "database"; // Name of database $db_error = ""; $sql = "select A, B, C from employee"; $data_set = get_data($sql); $num_rows = mysql_num_rows($data_set); if($num_rows > 0) { $row = mysql_fetch_array($data_set, MYSQL_NUM); $id = $row[0]; $name = $row[1]; $description = $row[2]; print ("id: $id <BR>"); print ("name:" . $name . "<BR>"); print ("description:" . $description . "<BR>"); print ("got here"); print ("got here"); print ("got here"); print ("got here"); print ("got here"); print ("got here"); print ("got here"); print ("got here"); print ("got here"); print ("got here"); } function get_data($sql) { global $DBHost, $DBLogin, $DBPassword, $DBDatabase, $db_error; if(!mysql_connect("$DBHost", "$DBLogin", "$DBPassword")) { return "$db_error"; } else { mysql_select_db("$DBDatabase"); return mysql_query($sql); } } ?> Expected result: ---------------- This should display: 1 John Smith Staff got heregot heregot heregot heregot heregot heregot heregot heregot heregot here Actual result: -------------- The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed. -------------------------------------------------------------------------------- Please try the following: Open the x.x.x.x home page, and then look for links to the information you want. Click the Refresh button, or try again later. Click Search to look for information on the Internet. You can also see a list of related sites. HTTP 500 - Internal server error Internet Explorer ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48233&edit=1

« previous php.bugs (#137170) next »