|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-05-22 15:20 UTC] kalowsky@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 13:00:01 2025 UTC |
I've written about 40 php-pages with about 15 classes and everything worked. (Win 2K, Apache, PHP 4.06, Adabas 12). In the last days I've copied some of the classes, put them in a new directory, changed the include directory to include only the new directory (thus no conflict with the old classes). The following error always happened: 1. If I use an exit statement after odbc_exec, then apache will pop-up a "php.exe has generated an error...", in the apache's error log found: "Premature end of script headers: c:/php/php.exe". Then the browser switched to 500 Internal Server Error. 2. The odbc_exec has done (partially?) it's work well. Because if the SQL-Statement is an INSERT one, the entry has been correctly stored in ADABAS. 3. If the exit statement omitted, no error throwed (as in script). All of the exit forms caused crash. 4. My assumption is: the exit statement caused php to cut(end) the thread process. But the odbc statement (thread?) is still running. As the odbc thread come to end, it returns some result to Apache, which can not find the php-process. ---> premature end. I hope you can understand the problem (sorry for my bad english). Greets, B. Rad Script: <? include_once("xpdfConstants.php"); function createContract() { //execute the query $conID = getConnection(); $sql = "SELECT * FROM \"Contract\""; $res = odbc_exec($conID, $sql); // exit; // exit(-1); // exit("ouchh..."); $rNum = odbc_num_rows($res); echo ("<BR>Found $rNum contracts <BR>"); } function getConnection() { global $DEBUG; global $DB_host, $DB_user, $DB_password; if (!($connectionID = odbc_connect ($DB_host,$DB_user, $DB_password))) { printError(0, "can not create a connection to $DB_SERVER", "authenticateUser"); return -1 ; } return $connectionID; } ?>