GalleryPhpVm.class on line 124

philomat

Joined: 2005-12-20
Posts: 8
Posted: Tue, 2005-12-20 12:11

Hi!
So far:
I installed Gallery2, embedded it in my website by using index.php?site=gallery.
everything works fine, EXEPT: while trying to login to admin or to register, an error appears:

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/polencup/exec/index.php:53) in /www/htdocs/polencup/exec/gallery/modules/core/classes/GalleryPhpVm.class on line 124

the folder g2data runs with chmod 777 and I cleared the Gallery cache so far. nothing happend.
everything else works, you are albe to watch the album, login screen can be displayed, exept the login itsself does not work.

I checked the path, and at the end of the path (on login) there seems something missing like: &g2_navId=xxxxxxx

if I add it, I CAN LOGIN!
so whats wrong?

pls help!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-12-20 12:13

do not output / print any HTML before you call GalleryEmbed::handleRequest

 
philomat

Joined: 2005-12-20
Posts: 8
Posted: Tue, 2005-12-20 17:11

GalleryEmbed::handleRequest ??

where do I find that?

I linked the gallery to an include to gallery2embedded.php

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-12-20 17:20

what's gallery2embedded.php ?

if you include that, then don't output anything before you include gallery2embedded.php

 
philomat

Joined: 2005-12-20
Posts: 8
Posted: Tue, 2005-12-20 18:09

I haven't, guess..

Quote:
don't output anything before you include gallery2embedded.php

I only included the gallery2embedded.php without putting any html before it.
check out youself here

I got gallery2embedded.php
from here

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-12-20 18:15

please attach a zip file with
- your gallery2embedded.php
- your file that includes gallery2embedded.php

common mistakes:
- empty lines/spaces before <?php / after ?>
- you have html before you include gallery2embedded.php / you have html / output something before calling Gallery::handleRequest (which is done in gallery2embedded.php)

 
philomat

Joined: 2005-12-20
Posts: 8
Posted: Thu, 2005-12-22 10:44

okay thx for your help, it put the 2 files into a zip-file here

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-12-22 12:14

gallery.php has a newline after ?> . remove it.

gallery2embedded.php has 2 empty newlines before <?php at the beginning. that's the problem. remove them. the file should start with <?php, no lines before allowed.

same at the end. put the ?> at the beginning of the line and remove the lines after ?>

 
philomat

Joined: 2005-12-20
Posts: 8
Posted: Thu, 2005-12-22 21:34

thx valiant for your help!
I followed your instruction, I deleted all empty lines as you said, but it didn't fix the problem.

The error keeps appearing :(

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-12-23 05:36

maybe consider using an existing integration or just customize the theme instead of trying to integrate g2 yourself...
i really can't write the integration for you and the

Warning: Cannot modify header information - headers already sent by ...

error is very basic in php. it even tells you at which line the output started. so it shouldn't be too hard to debug.

 
philomat

Joined: 2005-12-20
Posts: 8
Posted: Fri, 2005-12-23 08:52

okay I try to solve it myself by checking exec/index.php:53

hope I find it ..

however, thx for your help! :)

 
philomat

Joined: 2005-12-20
Posts: 8
Posted: Sun, 2005-12-25 13:03

I just cannot find the mistake!!

pls help!! here's my index.php , could anyone check it?

please ;(

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-12-25 14:52

elseif($site == news)

you'll have to put "news" , "gallery", .. into quotation marks! same for all strings

e.g.
elseif($site == 'gallery')
instead of
elseif($site == gallery)

also, you do $include = ...
and not include(...);

-> you don't include the file there.

and, right after the if elseif, ... thing, you do:

elseif($site == addnews)
{
	$include = "content/home/news/addnews.php";
	$tip = "";
	$rightinfo = "content/home/rightinfo.php";
}


?>

<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">

		<style>
		a:link.menu

so right after ?> you start outputting html to the browser. and you don't include the files before...

 
philomat

Joined: 2005-12-20
Posts: 8
Posted: Wed, 2005-12-28 09:20

well I need html to output my buttons which link to my gellery, don't I?