Click here to Skip to main content
15,504,549 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
Questionmysql_query error Pin
komanche7-Feb-11 23:31
komanche7-Feb-11 23:31 
AnswerRe: mysql_query error Pin
Gerben Jongerius8-Feb-11 4:13
Gerben Jongerius8-Feb-11 4:13 
Questiondisplay query result in a table using PHP Pin
PermissionDenied6-Feb-11 21:10
PermissionDenied6-Feb-11 21:10 
AnswerRe: display query result in a table using PHP Pin
Jules VDV9-Feb-11 5:56
Jules VDV9-Feb-11 5:56 
AnswerRe: display query result in a table using PHP Pin
Al4211-Feb-11 13:02
Al4211-Feb-11 13:02 
Questionmake tab&menu Pin
Elham M5-Feb-11 6:59
Elham M5-Feb-11 6:59 
AnswerRe: make tab&menu Pin
Eddy Vluggen19-Feb-11 4:05
professionalEddy Vluggen19-Feb-11 4:05 
QuestionProblem with PHP - FastCGI - Headers Pin
Lea Hayes4-Feb-11 14:51
Lea Hayes4-Feb-11 14:51 
Hey guys!

I am working on a dynamic website which fetches content from its database.

When the content for a specific request cannot be found I would like to display a custom 404 page. I have added the following lines at the top of my 404 script for SEO purposes:
if (substr(php_sapi_name(), 0, 3) == 'cgi')
    header("Status: 404 Not Found");
else
    header("HTTP/1.1 404 Not Found");

This has been working fine for me, but the website that I am working on at the moment is causing me problems. It is an Apache server running PHP 5.2 (FastCGI) on Linux CentOS.

Instead of showing the error page I get Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error.

In an attempt to isolate the problem I have created the following standalone page for testing this. This very simple script is failing:
<?php

if (substr(php_sapi_name(), 0, 3) == 'cgi')
	header("Status: 404 Not Found");
else
	header("HTTP/1.1 404 Not Found");

?>
<!DOCTYPE html>
<html>
<head>
	<title>My 404!!</title>
</head>
<body>
	<h1>My 404!!!</h1>
</body>
</html>



Any help would be greatly appreciated!

Kind regards,
AnswerRe: Problem with PHP - FastCGI - Headers Pin
Peter_in_27804-Feb-11 15:25
professionalPeter_in_27804-Feb-11 15:25 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes5-Feb-11 4:30
Lea Hayes5-Feb-11 4:30 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Peter_in_27806-Feb-11 14:40
professionalPeter_in_27806-Feb-11 14:40 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes7-Feb-11 1:26
Lea Hayes7-Feb-11 1:26 
AnswerRe: Problem with PHP - FastCGI - Headers Pin
Peter_in_27807-Feb-11 13:28
professionalPeter_in_27807-Feb-11 13:28 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes7-Feb-11 14:09
Lea Hayes7-Feb-11 14:09 
AnswerRe: Problem with PHP - FastCGI - Headers Pin
Peter_in_27807-Feb-11 15:00
professionalPeter_in_27807-Feb-11 15:00 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes8-Feb-11 1:11
Lea Hayes8-Feb-11 1:11 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
nickmaroulis8-Feb-11 10:36
nickmaroulis8-Feb-11 10:36 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes8-Feb-11 16:14
Lea Hayes8-Feb-11 16:14 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
nickmaroulis8-Feb-11 16:54
nickmaroulis8-Feb-11 16:54 
QuestionCreating file headers in php. Pin
Danzy8330-Jan-11 3:57
Danzy8330-Jan-11 3:57 
AnswerRe: Creating file headers in php. Pin
cjoki31-Jan-11 5:56
cjoki31-Jan-11 5:56 
AnswerRe: Creating file headers in php. Pin
Niall Barr31-Jan-11 12:51
professionalNiall Barr31-Jan-11 12:51 
GeneralRe: Creating file headers in php. [modified] Pin
Danzy8331-Jan-11 13:49
Danzy8331-Jan-11 13:49 
GeneralRe: Creating file headers in php. Pin
Niall Barr1-Feb-11 0:44
professionalNiall Barr1-Feb-11 0:44 
GeneralRe: Creating file headers in php. Pin
Danzy831-Feb-11 20:53
Danzy831-Feb-11 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.