Connecting Tech Pros Worldwide Help | Site Map

Sending headers in PHP under Godaddy linux hosting

Webrickco
Guest
 
Posts: n/a
#1: Jul 13 '08
Hi,

I have the following issue when i upload my files to my hosting. I
cannot send the following headers:

<?php
header('Content-Type: text/xml');
header('Pragma: no-cache');

When I execute the code, I get:

Warning: Cannot modify header information - headers already sent by
(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
in /home/content/d/a/v/davidc2p/html/testajax.php on line 1

Warning: Cannot modify header information - headers already sent by
(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
in /home/content/d/a/v/davidc2p/html/testajax.php on line 2

Notice that this code works perfectly on my local server because I
have added PHP_FLAG output_buffering on in my .htaccess file.

If I do this on my remote server, nothing happens and i continue to
have those 2 warnings. I also tried to use this command in the php.ini
file and nothing happened.

Can someone help me on that matter? I would really appreciate.

Michael Fesser
Guest
 
Posts: n/a
#2: Jul 13 '08

re: Sending headers in PHP under Godaddy linux hosting


..oO(Webrickco)
Quote:
>I have the following issue when i upload my files to my hosting. I
>cannot send the following headers:
>
><?php
>header('Content-Type: text/xml');
>header('Pragma: no-cache');
>
>When I execute the code, I get:
>
>Warning: Cannot modify header information - headers already sent by
>(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
>in /home/content/d/a/v/davidc2p/html/testajax.php on line 1
>
>Warning: Cannot modify header information - headers already sent by
>(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
>in /home/content/d/a/v/davidc2p/html/testajax.php on line 2
>
>Notice that this code works perfectly on my local server because I
>have added PHP_FLAG output_buffering on in my .htaccess file.
You should _disable_ output buffering and fix your code instead.
Check what causes the output and rethink the code structure.

Micha
Geoff Berrow
Guest
 
Posts: n/a
#3: Jul 13 '08

re: Sending headers in PHP under Godaddy linux hosting


Message-ID:
<c044889d-ab6d-4a00-8d4a-a2b94c3d8ebc@m36g2000hse.googlegroups.comfrom
Webrickco contained the following:
Quote:
>Warning: Cannot modify header information - headers already sent by
>(output started at /home/content/d/a/v/davidc2p/html/testajax.php:1)
>in /home/content/d/a/v/davidc2p/html/testajax.php on line 1
What's on line 1? Is it perhaps a blank line?

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
http://slipperyhill.co.uk
100110001101101111001011100111010101101011
Geoff Berrow
Guest
 
Posts: n/a
#4: Jul 13 '08

re: Sending headers in PHP under Godaddy linux hosting


Message-ID:
<4e255012-36fc-47d4-9922-18b5a9da464e@m36g2000hse.googlegroups.comfrom
Webrickco contained the following:
Quote:
>I don't think I'm am sending any blank line, or any output before my
>first header, otherwise, it wouldn't be working on my local server
Well you are obviously outputting headers! If not a blank line what
about an error notice before you send your headers?





--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk
Closed Thread