Results 1 to 4 of 4

Thread: Please help with installing my Contao-Site in the Web

  1. #1
    New user
    Join Date
    07-22-10.
    Posts
    8

    Default Please help with installing my Contao-Site in the Web

    Hi all,

    i post in the english forum too, as i am really desperate...

    I finally have succeeded in building my first and great Contao Website. Now i deployed that Website from my local box (running Win7) onto the 1und1.de Webspace. Runs fine etc...

    *But* as soon as i copy my modul into the system/modules folder and try to log into the backend i get very strange errors like tehse:

    Code:
    Warning: Cannot modify header information - headers already sent by 
    (output started at /homepages/25/d349048345/htdocs/system/modules/projektSeite/config/config.php:38) 
    in /homepages/25/d349048345/htdocs/system/libraries/System.php on line 520
    #0 [internal function]: __error(2, 'Cannot modify h...', '/homepages/25/d...', 520, Array)
    #1 /homepages/25/d349048345/htdocs/system/libraries/System.php(520): setcookie('BE_USER_AUTH', '154347f307efe9c...', 1291071135, '/', '', false)
    #2 /homepages/25/d349048345/htdocs/system/libraries/User.php(365): System->setCookie('BE_USER_AUTH', '154347f307efe9c...', 1291071135, '')
    #3 /homepages/25/d349048345/htdocs/system/libraries/User.php(286): User->generateSession()
    #4 /homepages/25/d349048345/htdocs/contao/index.php(65): User->login()
    #5 /homepages/25/d349048345/htdocs/contao/index.php(145): Index->__construct()
    #6 {main}
    
    Warning: Cannot modify header information - headers already sent by 
    (output started at /homepages/25/d349048345/htdocs/system/modules/projektSeite/config/config.php:38) 
    in /homepages/25/d349048345/htdocs/system/libraries/Template.php on line 186 
    #0 [internal function]: __error(2, 'Cannot modify h...', '/homepages/25/d...', 186, Array)
    #1 /homepages/25/d349048345/htdocs/system/libraries/Template.php(186): header('Content-Type: t...')
    #2 /homepages/25/d349048345/htdocs/system/modules/backend/BackendTemplate.php(142): Template->output()
    #3 /homepages/25/d349048345/htdocs/contao/index.php(137): BackendTemplate->output()
    #4 /homepages/25/d349048345/htdocs/contao/index.php(146): Index->run()
    #5 {main}
    I have no clue what do do.....
    Something is conflicting with my Module "projectSeite"...., i already tried & deleted the .htaccess files from the all involved folders, but no success...

    I reinstall & reinstall, but i do not get my nice little module to be accepted....

    Please, can somebody help me. I do not know how to go on from here...
    what can cause this pain?

    Thank you in advance for your very appreciated help.

    regards,
    - Karl

  2. #2
    New user
    Join Date
    07-22-10.
    Posts
    8

    Default Re: Please help with installing my Contao-Site in the Web

    strange...

    after fiddling around that night, i now always get the error:

    Code:
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/25/d349048345/htdocs/system/modules/projektSeite/config/config.php:38) in /homepages/25/d349048345/htdocs/system/libraries/Template.php on line 186 
    #0 [internal function]: __error(2, 'Cannot modify h...', '/homepages/25/d...', 186, Array)
    #1 /homepages/25/d349048345/htdocs/system/libraries/Template.php(186): header('Content-Type: t...')
    #2 /homepages/25/d349048345/htdocs/system/modules/frontend/FrontendTemplate.php(187): Template->output()
    #3 /homepages/25/d349048345/htdocs/system/modules/frontend/PageRegular.php(136): FrontendTemplate->output()
    #4 /homepages/25/d349048345/htdocs/index.php(198): PageRegular->generate(Object(DB_Mysql_Result))
    #5 /homepages/25/d349048345/htdocs/index.php(329): Index->run()
    #6 {main}
    This points to the line in Template.php:

    Code:
    header('Content-Type: ' . $this->strContentType . '; charset=' . $GLOBALS['TL_CONFIG']['characterSet']);
    so it has to do with the encoding...
    i encoded all files in my modul as "UTF-8 without BOM".

    What is going wrong here?

    Please help me!

    Thank you,

    - Karl

  3. #3
    New user
    Join Date
    07-22-10.
    Posts
    8

    Default Re: Solution for 'Warning: Cannot modify header information.

    Hi all,

    after a sleepless night & the help of a german Contao-ist (Thanks schman!), i found the solution.

    Summary
    Always ensure, that the custom files of your Module that you upload are encoded as "UTF-8 without BOM".

    Details:
    The BOM tells the file-parser, how multibyte-characters are stored in that file, Of Course, this is only meaningful in 'real' Unicode (UTF-16) encoded files, as every char is stored as two bytes.

    This is dependent of CPU. Intel CPUs for example, store MB-Chars with the least significant byte first in memory (Little Endian). So a char like the german 'ä' with the bytes "0x00E4" is stored as "0xE400". The "big Endian" way would be "0x00E4".

    Now, to specify in an UTF file how chars are laid out, the first two bytes in the file are the so called "BOM" (Byte Order Mark). For example for the Intel (Little Endian) it would be "0xFEFF".

    Furthermore, i remarked that you better do not have empty lines in front and at the end of the files (that is in front of the '<?php' and after the '?>' tags...) These "0x0D0A" sequences seem to confuse the PHP-Parser...

    Is this observation correct?

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Please help with installing my Contao-Site in the Web

    you can also avoid this, because German special characters always have HTML equivalents, so there is no real need to make a file contain special characters. You can just write &uuml; ( lowercase u with umlaut) instead. you should NEVER use german characters in variable names, etc.

    You are of course allowed characters in front of the <?php but for Contao, ONLY in templates, avoid any additional characters in your module files, as they cause output buffer writes to the output buffer, which will then cause a "headers already written" error message. HTML/PHP should be reserved ONLY for your template files. NO HTML should be written out by your PHP modules files unless you pass HTML strings to template variables.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •