Waring: Cannot add header information ?!?!??

tjsystems

Joined: 2003-05-13
Posts: 8
Posted: Wed, 2003-05-21 09:24

Hi there,

I have the follow problem.... somebody a idee?!?!

lery
Warning: Cannot add header information - headers already sent by (output started at /var/www/html/gallery2/config.php:1) in /var/www/html/gallery2/modules/core/classes/GallerySession.class on line 218

PHP 4.2.2
RedHat7.2

Gallery [url]www.timtest.com/gallery2[/url]DEBUG Mode

ThnX,

TJ

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-05-21 11:34

You must have something that prints a newline or something at the top of config.php. Edit that file and make sure there isn't a newline or other text at the top of it.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-05-21 12:11

If you look at the extract, what's being printed is "lery". Now, can someone say why?

 
tjsystems

Joined: 2003-05-13
Posts: 8
Posted: Wed, 2003-05-21 12:27

Ok, checked the config file....

no errors in the config file.. the file is normal, also made a new file...and run setup

Not working.... :(

 
tjsystems

Joined: 2003-05-13
Posts: 8
Posted: Wed, 2003-05-21 19:51

somebody a idee???

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-05-21 21:19

If you have command line access, cd to your gallery 2 directory and type this


grep 'lery' `find`

Preserve all quotes, those ` ` are important :)

 
tjsystems

Joined: 2003-05-13
Posts: 8
Posted: Wed, 2003-05-21 21:25
joyoflinux wrote:
If you have command line access, cd to your gallery 2 directory and type this


grep 'lery' `find`

Preserve all quotes, those ` ` are important :)

Nope... No command line access :cry:

some other thing i can do???

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-05-21 23:20
tjsystems wrote:
joyoflinux wrote:
If you have command line access, cd to your gallery 2 directory and type this

grep 'lery' `find`

Joyof, what kind of talk is this. That's never going to work! It would have to be something like
grep '\<lery\>' `find . -type f`

If you keep this up, we'll have to rename you sadoflinux.

tjsystems wrote:
Nope... No command line access :cry:

some other thing i can do???

Seems there is an error in config.php, as you get this error if you go to http://www.timtest.com/gallery2/config.php. Can you remove it and recreate it?[/b]

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-05-21 23:38

With all due respect, joan, the command does work. For instance, running the command on my Gallery 1.x source tree works:

Quote:
emachines333 gallery # grep 'joan' `find`
./ChangeLog:2003-05-20 Joan McGalliard <gallery@joanhenge.plus.com> 1.3.4-cvs-b33
./ChangeLog:2003-05-20 Joan McGalliard <gallery@joanhenge.plus.com> 1.3.4-cvs-b32
./ChangeLog:2003-05-20 Joan McGalliard <gallery@joanhenge.plus.com> 1.3.4-cvs-b31
./ChangeLog:2003-05-20 Joan McGalliard <gallery@joanhenge.plus.com> 1.3.4-cvs-b30
./ChangeLog:2003-05-20 Joan McGalliard <gallery@joanhenge.plus.com> 1.3.4-cvs-b29
./ChangeLog:2003-05-20 Joan McGalliard <gallery@joanhenge.plus.com> 1.3.4-cvs-b28

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2003-05-21 23:49

I'm sure Joan meant to add a smiley there.

And I'm also sure that both of you meant to say:

grep -r lery .

since that's the most efficient way to do it :-)

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-05-22 00:05
bharat wrote:

grep -r lery .

WRONG WRONG WRONG WRONG WRONG
:D :D :D :D :D

Seriously, the important point is not the search path, but the search string.
lery will match every incident of gallery which are clearly not the source of the problem. You want to search for '\<lery' or at least [^l]lery to avoid irrelevant matches.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2003-05-22 00:39

true that. I was just correcting your syntax for simplifying grep and find into just using grep. If you just want to find "lery" by itself, you should use:

grep -rw lery .

the -w flag handles making sure that what you're searching for is separated by word boundaries. The -r flag specifies recursion.

 
tjsystems

Joined: 2003-05-13
Posts: 8
Posted: Thu, 2003-05-22 11:07

IT WORKS...... :D

I don't know that it is.... but i recreated the config file, and it works...

i checkd the files, but the are the same. :-?

ThnX,

TJ

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Thu, 2003-05-22 11:43

*twilight zone music* There's probably something minor that did change, but we're glad you got it working :)

 
madison

Joined: 2002-09-13
Posts: 20
Posted: Thu, 2003-06-26 14:56
tjsystems wrote:
Warning: Cannot add header information - headers already sent

I was having the same problem with Gallery 2. Finally I traced it back to an apache module called Mod_Layout , which dynamically adds text to the head or foot of documents.

Luckly I admin the machine so I was able to disable it for the gallery2 directory.

If the URL of the images ended in .jpg then mod_layout wouldn't of touched the headers.

Hope this info helps someone :)