email_protect error

Schlum
2005-11-19
2013-04-17
  • Schlum
    Schlum
    2005-11-19

    Hi,

    I run a Debian Sarge and just installed ewiki. All files are located in /usr/share/ewiki

    Because I intend to host different domains, I did the following to set up ewiki:

    First I created a sym link from /usr/share/ewiki to /usr/share/php/ewiki (/usr/share/php is the include path of my php.ini).

    I then created a myconfig.php with the t_setupwizard script and edited it change the include to include_once and the include path to fit my conf.

    Finally I created an index.php :

    <?php
    include_once("myconfig.php");
    ?>
    <HTML>
    <BODY>
    <?php
    echo  ewiki_page();
    ?>
    </BODY>
    </HTML>

    (I use a MYSQL database, and the connection works fine)

    I have actually 2 errors :

    first,  the spages plugin complains about some files or dir it cannot open --> I disabled it as I don't need it right now.

    second, when I edit a page, I get the following error :
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/test.schlum.info/index.php:6) in /usr/share/ewiki/plugins/email_protect.php on line 107
    Thank you for your contribution!

    I guess it won't be a problem to desactivate the email_protect plugin for the moment, but I suspect that I have a problem with the plugin in general.

    More information : all files in /usr/share/ewiki are owned by root, with read right for everybody
    I can edit the page, even with this error.

    Do you have any idea what I did wrong ?

    BTW, thank's for this *excellent*  Wiki !!

    All the best,
    Schlum

     
    • Schlum
      Schlum
      2005-11-19

      I forgot to ask the other important question. Do you think that with this conf, all my users can create there own wiki by creating a myconfig.php in there web account ? Or ewiki also needs to store some information in the /usr/share/ewiki folder ??

       
    • Mario Salzer
      Mario Salzer
      2005-11-21

      To answer your first question, ewiki does not need write write permission in /usr/share/* or whereever else you installed the script and plugins. Your setup looks suitable for a multi-user/site setup.

      The "cannot modify header information.." error is caused by the fact, that your index.php sends output before the ewiki core script got activated. On many occasions it adds HTTP headers and this is not possible if some <html> or text already slipped through.

      You need to move the "echo ewiki_page();" up to the top - that is rewrite it to something like:

      <?php 
      include_once("myconfig.php"); 
      $EWIKI_PAGE = ewiki_page();
      ?>
      <HTML> 
      <BODY>
      <?php 
      echo $EWIKI_PAGE; 
      ?>
      </BODY>
      </HTML>

      Most often this suffices, and you can try to enable email_protect again (which is rather useful, after all).

      mario