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.
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.
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.
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
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
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.
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.
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.
Here is my accueil.php file :
Matthieu Rieux - Accueil
ACCUEIL
Again, many thanks for your help.
Not sure to fully understand.
So, I've tried without the first line.
Without success.
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"
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.
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"
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.