Re: [PHP] Sending headers to server

[email protected] (Karim Geiger)
Newsgroups php.general
Message-ID <[email protected]>
Hi Miguel,

On 08/02/2013 04:34 PM, Miguel Guedes wrote:
> 
> Here's my output:
> 
> $ curl -v http://localhost/header-test.php
> * About to connect() to localhost port 80 (#0)
> *   Trying 127.0.0.1...
> * Connected to localhost (127.0.0.1) port 80 (#0)
>> GET /header-test.php HTTP/1.1
>> User-Agent: curl/7.29.0
>> Host: localhost
>> Accept: */*
>>
> < HTTP/1.1 200 OK
> < Date: Fri, 02 Aug 2013 14:32:47 GMT
> < Server: Apache/2.2.22 (Ubuntu)
> < X-Powered-By: PHP/5.4.9-4ubuntu2.2
> < Status: 500 Internal Server Error
> < Vary: Accept-Encoding
> < Content-Length: 0
> < Content-Type: text/html
> <
> * Connection #0 to host localhost left intact
> 
> Using the following test script:
> 
> <?php
> 
> header('Status: 500 Internal Server Error');
> header('HTTP/1.1 500 Internal Server Error', true, 500);
> 
> ?>

allright, that's weird. I'm currently not able to reproduce your problem
but I've found out that some others are experiencing the same problem
like you do. They found this solution to work:
header($_SERVER["SERVER_PROTOCOL"] . 'HTTP/1.1 500 Internal Server Error');

Might try this one..

Regards

Karim


-- 
Karim Geiger
Auszubildender Fachinformatiker AE

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
signature.asc (application/pgp-signature, 555 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJR+8bnAAoJEP3U0UyBvgwDjfkH/AlNOtoon4geIHdGCbhb+98V
mG47ACjy9HBF5xgBLbCxtABkPqrl6g6A26c0OhXVpDSl6YIVxjKTHKftNwulHB0f
FJMW0xqg43JFjv3Vnzoc0fIFYtdCIlN+2ulm6GVJ8L/cknKWgYdZfys9+wHWV9/6
G+Xqoe+H6HpsGCb9C0iywTDwODAATdw3bN+mEaYvDuH+/q5H5PZEH233QVmu4tk7
LDk3rCqrvlh2vbuY8VdJF3+5kPr2F6AKQb7kkKRZ0/hIKPbc+co69oBIt1ba89Gs
nUBz5XJ1DhAlY5wAjfb08TWDsUwLBSHf18lgafErG/LWT4aRTNcYmJeIongE6Ag=
=/dmV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.