#128 Squirrelmail does not work with PHP 5.1.2

closed
nobody
None
5
2006-08-13
2006-07-23
jamess
No

Here is my summary after trying to get Squirrelmail to
work with PHP 5.1.2:

1) 1.4.7 - no hope

2) 1.5.1 - works partially; hangs up in login and
logout; reads and composes mail correctly

3) 1.5.2 - 20060724 checkpoint and current top do the
same thing when attempting to run the login script:

-----------------------------------------------
Notice: Undefined variable: a in
/d0/mary/squirrelmail/include/init.php on line 85

Notice: Undefined variable: a in
/d0/mary/squirrelmail/include/init.php on line 92

Warning: array_slice() [function.array-slice]: The
first argument should be an array in
/d0/mary/squirrelmail/include/init.php on line 92

Warning: implode() [function.implode]: Bad arguments.
in /d0/mary/squirrelmail/include/init.php on line 92

Warning: require(functions/global.php)
[function.require]: failed to open stream: No such file
or directory in /d0/mary/squirrelmail/include/init.php
on line 128

Fatal error: require() [function.require]: Failed
opening required 'functions/global.php'
(include_path='.:/usr/local/lib/php') in
/d0/mary/squirrelmail/include/init.php on line 128
---------------------------------------------------

The code in include/init.php:

/**
* calculate SM_PATH and calculate the base_uri
* assumptions made: init.php is only called from
plugins or from the src dir.
* files in the plugin directory may not be part of a
subdirectory called "src"
*
*/
if (isset($_SERVER['SCRIPT_NAME'])) {
$a = explode('/',$_SERVER['SCRIPT_NAME']);
} elseif (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
$a = explode('/',$_SERVER['SCRIPT_NAME']);
}
$sSM_PATH = '';
for($i = count($a) -2;$i > -1; --$i) {
$sSM_PATH .= '../';
if ($a[$i] === 'src' || $a[$i] === 'plugins') {
break;
}
}

$base_uri = implode('/',array_slice($a,0,$i)). '/';

appears to fail if both of the if clauses are false.

Not sure what this is supposed to be doing. Any
suggestions?

Thanks!

Discussion

  • jamess

    jamess - 2006-07-23

    Logged In: YES
    user_id=1560631

    MORE INFO:

    if (isset($_SERVER['SCRIPT_NAME'])) {
    $a = explode('/',$_SERVER['SCRIPT_NAME']);
    } elseif (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
    $a = explode('/',$HTTP_SERVER_VARS['SCRIPT_NAME']);
    } else {
    $a = explode('/',$_SERVER['REQUEST_URI']);
    }

    seems to work better.

    1) The second clause was wrong (checked for HTTP_SERVER_VARS
    but used _SERVER anyway).

    2) Some web servers apparently set REQUEST_URI but not
    SCRIPT_NAME.

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2006-07-24

    Logged In: YES
    user_id=225877

    Please provide information about your PHP setup (DSO, CGI,
    FastCGI or something else), used webserver, PHP core
    settings and PHP session settings.

    Please check http://www.squirrelmail.org/wiki/KnownBugs.
    SquirrelMail 1.5.1 has known issues with PHP 5.1.2.

    Please explain "1.4.7 - no hope" issue. Hope is not included
    in 1.5.x packages too.

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2006-07-29

    Logged In: YES
    user_id=225877

    'Notice: Undefined variable: a' issue is fixed in 1.5.2cvs.

    Please remember that SquirrelMail developers need your
    feedback in order to understand other issues. This tracker
    will close if no feedback is received.

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2006-07-29
    • milestone: 241848 -->
    • status: open --> pending
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     

Log in to post a comment.