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

Linux, Apache, MySQL, PHP

 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Peter_in_27806-Feb-11 13:40
professionalPeter_in_27806-Feb-11 13:40 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes7-Feb-11 0:26
Lea Hayes7-Feb-11 0:26 
AnswerRe: Problem with PHP - FastCGI - Headers Pin
Peter_in_27807-Feb-11 12:28
professionalPeter_in_27807-Feb-11 12:28 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes7-Feb-11 13:09
Lea Hayes7-Feb-11 13:09 
AnswerRe: Problem with PHP - FastCGI - Headers Pin
Peter_in_27807-Feb-11 14:00
professionalPeter_in_27807-Feb-11 14:00 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes8-Feb-11 0:11
Lea Hayes8-Feb-11 0:11 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
nickmaroulis8-Feb-11 9:36
nickmaroulis8-Feb-11 9:36 
GeneralRe: Problem with PHP - FastCGI - Headers Pin
Lea Hayes8-Feb-11 15:14
Lea Hayes8-Feb-11 15:14 
The error log doesn't show any related errors. The access log shows the following (I called the test file t404.php):

[05/Feb/2011:00:59:51 +0000] 92.232.71.252 - - "GET /t404.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.84 Safari/534.13"

This indicates that the header status is being changed, but for some reason the content is not being presented to end-user.

The following code is still producing blank output in Chrome, but it IS creating the "test.txt" file with the contents 'Hello World!'. So this indicates that the script is in fact being executed.
<?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>
<?php

$fp = fopen('test.txt', 'w');
fwrite($fp, 'Hello World!');
fclose($fp);

?>


This doesn't make any sense at all to me...
GeneralRe: Problem with PHP - FastCGI - Headers Pin
nickmaroulis8-Feb-11 15:54
nickmaroulis8-Feb-11 15:54 
QuestionCreating file headers in php. Pin
Danzy8330-Jan-11 2:57
Danzy8330-Jan-11 2:57 
AnswerRe: Creating file headers in php. Pin
cjoki31-Jan-11 4:56
cjoki31-Jan-11 4:56 
AnswerRe: Creating file headers in php. Pin
Niall Barr31-Jan-11 11:51
professionalNiall Barr31-Jan-11 11:51 
GeneralRe: Creating file headers in php. [modified] Pin
Danzy8331-Jan-11 12:49
Danzy8331-Jan-11 12:49 
GeneralRe: Creating file headers in php. Pin
Niall Barr31-Jan-11 23:44
professionalNiall Barr31-Jan-11 23:44 
GeneralRe: Creating file headers in php. Pin
Danzy831-Feb-11 19:53
Danzy831-Feb-11 19:53 
Questionsending a link to php script Pin
Danzy8327-Jan-11 14:15
Danzy8327-Jan-11 14:15 
AnswerRe: sending a link to php script Pin
Gerben Jongerius27-Jan-11 19:54
Gerben Jongerius27-Jan-11 19:54 
QuestionForm not working... Pin
MacRaider426-Jan-11 7:53
MacRaider426-Jan-11 7:53 
AnswerRe: Form not working... Pin
MacRaider426-Jan-11 8:33
MacRaider426-Jan-11 8:33 
Questioni cant view this file Pin
ulio.pts21-Jan-11 22:24
ulio.pts21-Jan-11 22:24 
AnswerRe: i cant view this file Pin
Kristian Sixhøj24-Jan-11 3:57
Kristian Sixhøj24-Jan-11 3:57 
QuestionThe joys of PHP mail() Pin
SRJ9221-Jan-11 9:46
SRJ9221-Jan-11 9:46 
AnswerRe: The joys of PHP mail() Pin
Dr.Walt Fair, PE21-Jan-11 12:01
professionalDr.Walt Fair, PE21-Jan-11 12:01 
GeneralRe: The joys of PHP mail() Pin
SRJ9221-Jan-11 15:06
SRJ9221-Jan-11 15:06 
GeneralRe: The joys of PHP mail() Pin
Dr.Walt Fair, PE21-Jan-11 15:33
professionalDr.Walt Fair, PE21-Jan-11 15:33 

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.