Forum Moderators: coopster

Message Too Old, No Replies

Header problem?

Not show error script

         

fabiox

8:06 pm on May 6, 2005 (gmt 0)

10+ Year Member



Why this script not error:(Headers cannot send ....)
<?
print 'x';
header('Location:../index.php');
?>
He is redirect and not show the error when a output is before.

Stormfx

8:49 pm on May 6, 2005 (gmt 0)

10+ Year Member



Perhaps the error_reporting in your php.ini is wrong?

fabiox

8:53 pm on May 6, 2005 (gmt 0)

10+ Year Member



is E_ALL.

gettopreacherman

8:59 pm on May 6, 2005 (gmt 0)

10+ Year Member



header('Location:../index.php');

try

header('Location: index.php');

jatar_k

9:05 pm on May 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I actually get the headers already sent error with the exact code you posted fabiox, not sure why you don't.

ramoneguru

10:07 pm on May 6, 2005 (gmt 0)

10+ Year Member



Would double quotes make a difference?

<?php
print 'x';
header("Location:../index.php");
?>

I get an error with that and with your original code.What version of php do you have?

My Outupt:
x
Warning: Cannot modify header information - headers already sent.......

--Nick

coopster

1:56 pm on May 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It should and will error out with E_ALL, unless there is a php.ini configuration override somewhere along the line. Places to look ...
  1. Apache <File>/<Directory>/<VirtualHost> containers
  2. per-directory override (.htaccess files)
  3. ini_set() or error_reporting() in the script being executed
  4. ini_set() or error_reporting() in any include() files

fabiox

5:36 pm on May 7, 2005 (gmt 0)

10+ Year Member



The version is 4.3.11(last).

ramoneguru

9:56 pm on May 7, 2005 (gmt 0)

10+ Year Member



Yeah, better listen to coopster and check those files.
--Nick

fabiox

12:47 pm on May 9, 2005 (gmt 0)

10+ Year Member



<Directory "/usr/local/apache/htdocs">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>

--------------------------------
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
--------------------------------

The part (ini_set() , error_reporting()) i not understood...

fabiox

4:16 pm on May 9, 2005 (gmt 0)

10+ Year Member



The follow script no show error too:

print 'x'

( correct: print 'x'; )

fabiox

12:38 pm on May 10, 2005 (gmt 0)

10+ Year Member



Well i find solution.
I moved the php.ini that was in /usr/local/lib/ for /etc/ and works.
Thanks...