CGI Error about HTTP headers

Posted on 2006-07-05
Medium Priority
Last Modified: 2008-03-04

I'm trying to retrieve image from Oracle using php.
My code sometimes works, but sometimes returns error bellow.
What's wrong with this code.
Please help me.

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


      $table = 'fnsonld.emp_emp';
      $fldblob = 'PHOTO';
      $fldid = 'EMPID';
      $valid = '16';

      $query = 'SELECT '.$fldblob.' FROM '.$table.' WHERE '.$fldid.'='.$valid;
      $stmt = oci_parse ($conn, $query);
      oci_execute($stmt, OCI_DEFAULT);
      $arr = oci_fetch_assoc($stmt);
      $result = $arr[$fldblob]->load();
      header("Content-type: image/JPEG");
      echo $result;
      oci_close($conn); // log off
Question by:jambuul
  • 4
  • 2
LVL 29

Accepted Solution

TeRReF earned 250 total points
ID: 17040987
I've had these errors myself. I guess you're running windows? It's a knows CGI bug. Use ISAPI to get rid of the error.

Author Comment

ID: 17041024
How can I install PHP5 ISAPI on WinXP SP2?
I don't know about it.
LVL 29

Expert Comment

ID: 17041137
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

LVL 29

Expert Comment

ID: 17048638
May I ask why you gave me a C grade?

Author Comment

ID: 17048656
I didn't manage configure PHP5 ISAPI on WinXPSP2.
I'm still using CGI.
LVL 29

Expert Comment

ID: 17048693
That's too bad :(

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
I recently worked on a Wordpress site that utilized the popular ContactForm7 (https://contactform7.com/) plug-in that only sends an email and does not save data. The client wanted the data saved to a custom CRM database. This is my solution.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question