Pages (2): 1 2   
Member
Member
MatthRieux   05-07-2010, 20:02
#1

Hi,

I'm trying to use some of the zenphoto functions on my web site.
Unfortunately, I may have made some mistakes in my code.
I actually have the following errors :
Warning: Cannot modify header information - headers already sent by (output started at /.../accueil.php:2) in /.../galeries/zp-core/functions.php on line 1551

I include the zenphoto functions using this code :
if (!defined('WEBPATH')) define('WEBPATH', 'galeries/');
require_once(WEBPATH . "/zp-core/folder-definitions.php");
require_once(WEBPATH . ZENFOLDER . "/template-functions.php");

Thanks in advance for helping me.

Member
Member
sbillard   05-07-2010, 21:07
#2

Most likely you have placed these (or the functions) in the wrong place in your script. You must have these statements before our script creates any output [thus the gist of the error message.]

The other source of this error is when you have a "blank" line in your script before (or after) the section.

Member
Member
MatthRieux   06-07-2010, 18:15
#3

Many thanks for your answer.
I tried to place those lines at the beginning of my page :

Without any blank space before or after the
And I still have the same warnings.
Do you have any other idea ?
Thanks for spending time with my issues.

Administrator
Administrator
acrylian   06-07-2010, 18:22
#4

If you are using another CMS for the rest of your site this might not work. It does for sure not with Wordpress for example and it is its "fault".

Member
Member
MatthRieux   06-07-2010, 18:34
#5

It's not a CMS.
It's my personal website that I develop by my own.
I may make a mistake somewhere.
If you like to see :
http://www.matthieurieux.com

Administrator
Administrator
acrylian   06-07-2010, 19:08
#6

Ok, I see but I can't dig into that. Seems you have some other code generating output before that.

Don't know what you are planning but maybe doing the site entirely with Zenphoto and the Zenpage plugin would also be an option.

Member
Member
MatthRieux   06-07-2010, 19:44
#7

For a test, I tried to upload a web page with only this code :

And the warnings still appear.
Nevertheless, I thought that was the way to call the zenphoto functions.
Can you confirm ?
Thanks for helping me

Administrator
Administrator
acrylian   06-07-2010, 20:01
#8

It is the so called "zenphoto as a 'plugin'" way. Try to leave out the folder definitions one and remove the slash after the WEBPATH define:
http://www.zenphoto.org/2009/12/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/

However, this is nothing we really test frequently as Zenphoto is meant as a standalone script.

Member
Member
sbillard   06-07-2010, 23:47
#9

The warning will tell you where the output is happening. In the first case it was on your line #2, the doctype tag.

What is the message for the second test? Maybe you still have a blank line or something prior to those lines of PHP code.

Member
Member
MatthRieux   10-07-2010, 19:32
#10

Thanks for your help.
I've made again the test #2.
And I have exactly the same error :
Warning: Cannot modify header information - headers already sent by (output started at ... /accueil.php:2) in ... zp-core/functions.php on line 1551
Furthermore, I don't have any extra blank line.
Thanks again.

Member
Member
sbillard   10-07-2010, 21:28
#11

Well, you are outputting something at line 2 of your accueil.php script. Certainly we cannot tell what since we do not have that script to review. Presumably also the PHP code you inserted is after that line (since, among other things there are three lines to the code.)

You need to fix accueil.php line 2.

Member
Member
abbiekye   11-07-2010, 11:35
#12

Yes the error messages usually point you to the offending file or location. I'll definitely have a look again at accueil.php to work out what the problem is.

Member
Member
MatthRieux   18-07-2010, 13:05
#13

Here is my accueil.php file :

Matthieu Rieux - Accueil
















                ACCUEIL

Again, many thanks for your help.

Member
Member
sbillard   18-07-2010, 17:46
#14

Quote:
This is output. Perhpas you need to review how PHP works.

Member
Member
MatthRieux   19-07-2010, 15:52
#15

Not sure to fully understand.
So, I've tried without the first line.
Without success.

Administrator
Administrator
acrylian   19-07-2010, 16:08
#16

You have probably an error somewhere, might be the require_once stuff for the Zenphoto functions that might not work. There would be an error in your server's error log about that somewhere. Since it does not happen on the pure Zenphoto part "Photos" it is most likely something with your php pages outside Zenphoto.

Since you don't use another CMS you could do these pages as Zenphoto custom pages as well (or even using the Zenpage plugin) and then you would not need to include Zenphoto functions at all. See the theming tutorial maybe.

Also Safari reports a file not found on "http://www.matthieurieux.com/img/banniere.jpg"

Member
Member
MatthRieux   19-07-2010, 16:22
#17

No, I don't.
You're right.
That's not my job actually.
Thanks for your patience.

On the server, there is an error.log file with (for example) :
[19-Jul-2010 18:13:15] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/matthie1/public_html/materiel.php:2) in /home/matthie1/public_html/galeries/zp-core/functions.php on line 1551

That's all the information I have.

Member
Member
sbillard   19-07-2010, 17:44
#18

You also have the responses of this thread. Which apparently you do not understand. I don't think I can be more explicit. The error message says that you have generated output at line 2 of your script. Line 2 is as quoted above. Having generated output at line 2 you cannot successfully call functions that do things like headers and cookies. So you have to fix line 2 as originally stated.

I think from this conversation that your skills with PHP are probably not sufficient for you to be successful with this project. Certainly you cannot expect us to do your task for you. "that's not OUR job actually"

Member
Member
MatthRieux   19-07-2010, 18:32
#19

No problem.
I don't expect you to do my tasks.
Even if you have understood the contrary.
I'm sorry for that (English is not my native language)
Thanks for your help and your reactivity.
I appreciate.
I'll try to find out what are the php reasons that make the output at line 2.
(I agree with you, I'm not familiar enough with php and html).

Matthieu

PS : the acrylian's post has been edited while creating mine, so responses to his questions don't make any sense now, that could explain our misunderstanding.

Administrator
Administrator
acrylian   20-07-2010, 08:33
#20

I had editied a little to show an easier altenative in using Zenphoto/Zenpage for everything on your site, in case that is possible.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.