#1470 PEAR error renders attachments unreadable from remote hosts

BRANCH-1-8_(CVS)
closed
nobody
5
2004-08-26
2004-05-25
Joe
No

I'm running Tiki v1.8.3 (CVS) atop the latest EasyPHP
(v1.7) distribution. The Tiki setup went smoothly and
I enabled wikis and forums. From the machine hosting
Tiki I can upload and download attachments with ease
but from other machines I can not downoad attachments.
This holds for both the wiki and the forum. This
problem is not browser specific as both Internet
Explorer and Netscape return the same error. The error
is as follows when attempting to download the
attachment with this URL
/tikiwiki/tiki-download_wiki_attachment.php?attId=15.
Thanks for entertaining this as an bug. -Joe

Warning: main(PEAR.php): failed to open stream: No such
file or directory in c:\easyphp17
\www\tikiwiki\lib\adodb\adodb-pear.inc.php on line 41

Warning: main(): Failed opening 'PEAR.php' for inclusion
(include_path='lib/adodb;.;c:\php4\pear') in
c:\easyphp17 \www\tikiwiki\lib\adodb\adodb-pear.inc.php
on line 41

Warning: main(PEAR.php): failed to open stream: No such
file or directory in c:\easyphp17
\www\tikiwiki\lib\adodb\adodb-errorpear.inc.php on line 13

Warning: main(): Failed opening 'PEAR.php' for inclusion
(include_path='lib/adodb;.;c:\php4\pear') in
c:\easyphp17
\www\tikiwiki\lib\adodb\adodb-errorpear.inc.php on line 13

Warning: main(PEAR.php): failed to open stream: No such
file or directory in c:\easyphp17
\www\tikiwiki\lib\pear\Net\Socket.php on line 23

Fatal error: main(): Failed opening required 'PEAR.php'
(include_path='lib/adodb;.;c:\php4\pear') in
c:\easyphp17 \www\tikiwiki\lib\pear\Net\Socket.php on
line 23

Discussion

  • Philippe Cloutier

    Logged In: YES
    user_id=738765

    I doubt this code changed recently.
    PEAR.php is shipped in tiki/lib/pear/, but your include_path
    misses tiki/lib/pear/ as tiki/db/tiki-db.php is supposed to
    set on line 77 :
    TikiInit::prependIncludePath('lib/pear');
    This happens just before
    include_once ('adodb-pear.inc.php');
    at line 86, which contains the problematic includes. Your
    include_path has instead "c:\php4\pear", any idea why?

    In summary tiki-download_wiki_attachment.php includes
    tiki-setup_base.php which includes tiki/db/tiki-db.php which
    should add tiki/lib/pear to include_path before it includes
    tiki/lib/adodb/adodb-pear.inc.php which doesn't work due to
    problem with include_path.

    It would be *particularly* strange that your include_path
    would only be misconfigured when the script is not called
    locally.

     
  • Philippe Cloutier

    • milestone: 356877 --> BRANCH-1-8_(CVS)
     
  • Joe

    Joe - 2004-05-30

    Logged In: YES
    user_id=1049822

    OK, I've altered adodb-errorpear.inc.php, adodb-pear.inc.php
    and Socket.php so the path to PEAR.php is explicit. The
    "main(PEAR.php): failed to open stream" errors are now gone.
    Instead some other errors appear at the top of every
    TikiWiki page regardless if it is localhost or remote.
    These errors are (note that I've changed the tikiwiki home
    directory when I reinstalled it):

    Warning: session_start(): Cannot send session cookie -
    headers already sent by (output started at
    c:\easyphp17\www\tiki_install2\lib\adodb\adodb-errorpear.inc.php:88)
    in c:\easyphp17\www\tiki_install2\tiki-setup_base.php on line 46

    Warning: session_start(): Cannot send session cache limiter
    - headers already sent (output started at
    c:\easyphp17\www\tiki_install2\lib\adodb\adodb-errorpear.inc.php:88)
    in c:\easyphp17\www\tiki_install2\tiki-setup_base.php on line 46

     
  • Joe

    Joe - 2004-05-30

    Logged In: YES
    user_id=1049822

    After logging out afte the alterations for the PEAR.php
    path, it appears I now can no longer even login!

    http://127.0.0.1/tiki_install2/tiki-login.php

    Warning: session_start(): Cannot send session cookie -
    headers already sent by (output started at
    c:\easyphp17\www\tiki_install2\lib\adodb\adodb-errorpear.inc.php:88)
    in c:\easyphp17\www\tiki_install2\tiki-setup_base.php on line 46

    Warning: session_start(): Cannot send session cache limiter
    - headers already sent (output started at
    c:\easyphp17\www\tiki_install2\lib\adodb\adodb-errorpear.inc.php:88)
    in c:\easyphp17\www\tiki_install2\tiki-setup_base.php on line 46

    Warning: error: You have an error in your SQL syntax. Check
    the manual that corresponds to your MySQL server version for
    the right syntax to use near '' at line 1 in query:
    select `email` from `users_users` where `login` = ?
    in c:\easyphp17\www\tiki_install2\lib\tikidblib.php on line 125
    Values:
    Array ( [0] => )
    $result is false
    $result is empty

     
  • Joe

    Joe - 2004-05-30

    Logged In: YES
    user_id=1049822

    OK. Maybe it's OK to disregard the previous two Followups.
    I was fumbling around and prematurely posted. It appears
    I've resolved the problem thanks to the comments of chealer.
    In a fresh install the problem reappears. That is, I get
    the following error message when trying to download an
    attachment using URL
    http://127.0.0.1/tiki_install3/tiki-download_wiki_attachment.php?attId=19
    Note that the error now appears wheb the browser is located
    on localhost AND from a browser on a remote machine--I don't
    know why it was remote only before.

    -------------------------------
    Warning: main(PEAR.php): failed to open stream: No such file
    or directory in
    c:\easyphp17\www\tiki_install3\lib\adodb\adodb-pear.inc.php
    on line 41

    Warning: main(): Failed opening 'PEAR.php' for inclusion
    (include_path='lib/adodb;.;c:\php4\pear') in
    c:\easyphp17\www\tiki_install3\lib\adodb\adodb-pear.inc.php
    on line 41

    Warning: main(PEAR.php): failed to open stream: No such file
    or directory in
    c:\easyphp17\www\tiki_install3\lib\adodb\adodb-errorpear.inc.php
    on line 13

    Warning: main(): Failed opening 'PEAR.php' for inclusion
    (include_path='lib/adodb;.;c:\php4\pear') in
    c:\easyphp17\www\tiki_install3\lib\adodb\adodb-errorpear.inc.php
    on line 13

    Warning: main(PEAR.php): failed to open stream: No such file
    or directory in
    c:\easyphp17\www\tiki_install3\lib\pear\Net\Socket.php on
    line 23

    Fatal error: main(): Failed opening required 'PEAR.php'
    (include_path='lib/adodb;.;c:\php4\pear') in
    c:\easyphp17\www\tiki_install3\lib\pear\Net\Socket.php on
    line 23
    -----------

    If the tiki-db.php file is then edited by adding
    TikiInit::prependIncludePath('lib/pear');
    after
    TikiInit::prependIncludePath('lib/adodb');
    the problem goes away and the same URL permits access to the
    attachment. I don't know why this change is necessary. Any
    ideas?

     
  • Damian Parker

    Damian Parker - 2004-08-26
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks