zenphoto forums » General Zenphoto Discussion

warning in my debug log

(10 posts)
  • Started 2 weeks ago by vincent3569
  • Latest reply from sbillard

No tags yet.

  1. vincent3569

    Contributor
    Joined: Nov '08
    Posts: 875

    Hi,

    I often have this warning in my debug log.
    I can't figure where is the matter.

    Do you have an idea?

    WARNING: Cannot modify header information - headers already sent by (output started at /home/avbo7291/public_html/zenphoto/themes/zpArdoise/inc_header.php:8) in /home/avbo7291/public_html/zenphoto/zp-core/functions-common.php on line 499
    setcookie called from zp_setCookie (functions-common.php [499])
    from getUserLocale (functions-i18n.php [444])
    from htmlmetatags::getHTMLMetaData (html_meta_tags.php [183])
    from call_user_func_array (unknown)
    from zp_apply_filter (functions-filter.php [149])
    from include (inc_header.php [9])
    from include (pages.php [3])
    from include (index.php [130])
    from index.php [28]

    the line 8 of inc_header.php is the following, as other official themes (like zenpage):

    <?php
    // force UTF-8 Ø
    if (!defined('WEBPATH')) die();
    ?>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="<?php echo getOption('charset'); ?>">
    <?php zp_apply_filter('theme_head'); ?>
    [...]

    Posted 2 weeks ago #
  2. Zenphoto development team
    acrylian

    Zenphoto team
    Joined: Jul '07
    Posts: 16,800

    Official 1.4.14 or support build? In the latter there has been a small change in cookie handling (to be exact the parameters they are setup). Try clearing all cookies via the browser and try again please.

    Don't forget to read the Forum rules and usage resources
    Posted 2 weeks ago #
  3. vincent3569

    Contributor
    Joined: Nov '08
    Posts: 875

    I use official 1.4.14.
    For sure, I can clearing all my cookies, but I can't do that for all my vistors.
    This message is in english, so I suspect my vistor to not be me :-)
    Btw, I have some messages in french, some en english.

    Posted 2 weeks ago #
  4. Zenphoto development team
    acrylian

    Zenphoto team
    Joined: Jul '07
    Posts: 16,800

    Of course you cannot clear cookies for visitors. This was just in case you used the support build and actually only should affect the actual main login cookies.

    I will take a look but never saw this as far as I remember. Is there any locale printed in the charset meta?

    Don't forget to read the Forum rules and usage resources
    Posted 2 weeks ago #
  5. MarkRH

    Senior
    Joined: Jun '14
    Posts: 92

    Wonder if some bot was snooping around looking for various things and called some php file that normally isn't called directly?

    I'd compare that entry with the webserver's access logs to see what was being called when that happened.

    I haven't seen this one myself.

    I usually get some warning about ADMIN_RIGHTS not being defined.

    Posted 2 weeks ago #
  6. sbillard

    Contributor
    Joined: May '07
    Posts: 10,513

    You should look in your server's PHP error log. The error basically says that something has been output already so setting a cookie is not allowed. So what is needed is to find out what has been output. Probably an error message or such that cannot be trapped by Zenphoto.

    Posted 2 weeks ago #
  7. vincent3569

    Contributor
    Joined: Nov '08
    Posts: 875

    I have no error on the debug log that I can access on my prod server :-(

    If could be usefull, I can hack zenphoto core files to log something in debug log but you have to point me in the right direction.

    Posted 2 weeks ago #
  8. vincent3569

    Contributor
    Joined: Nov '08
    Posts: 875

    Today, I have onother NOTICE in my debug log :

    NOTICE: Undefined index: path in /home/avbo7291/public_html
    zenphoto/zp-core/zp-extensions/dynamic-locale.php on line 92
    printLanguageSelector called from include (inc_header.php [240])
    from include (404.php [1])
    from include (404.php [43])
    from include (index.php [135])
    from index.php [28]
    Posted 2 weeks ago #
  9. Zenphoto development team
    acrylian

    Zenphoto team
    Joined: Jul '07
    Posts: 16,800

    That error is related to the url request path to switch languages. So it might very well be like MarkRH suspects that someone is trying to set a language that is not existing somehow or some spam bot is trying to do things he is not supposed to do.

    Don't forget to read the Forum rules and usage resources
    Posted 2 weeks ago #
  10. sbillard

    Contributor
    Joined: May '07
    Posts: 10,513

    It would be really useful to see the actual request URI for these errors. You can add code to debugLogBacktrace() to include this in the log. The "correct" code is a bit long for this post, but you can adapt it from the ZenPhoto20 release where it has been present for a while.

    It the first case, there is some issue with the initial establishment of the language. So when getHEMLMetaData calls getUserLocale() the latter thinks it needs to set the locale cookie, but it is too late in the process as the theme has already started output. (ZenPhoto20 no longer uses this flawed implementation of getUserLocale().)

    The second error implies that parse_url() did not return a path item. I really don't know how that is possible, thus it would be nice to see the actual url that was used.

    Posted 2 weeks ago #

RSS feed for this topic

Reply

You must log in to post.