Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: Geeforce on August 08, 2009, 08:38:52 AM

Title: running on PHP 5.1.6..
Post by: Geeforce on August 08, 2009, 08:38:52 AM
What are the exact reasons for needing php 5.2?

Just "hacked" the check.php script, because I don't want to "mess up" my base CentOS  5.3 system which suns php 5.1.6. Of course I know I can use other repo's like remi, but that installs other things too, what I don't want to do at the moment.

I installed 0.3rc,and have been playing with it but as far I can see it runs fine on 5.1.6. But I don't know what happens under water.
Title: running on PHP 5.1.6..
Post by: rwssoccer1 on August 09, 2009, 10:59:31 PM
all u have to do is "yum update php" in ssh to update it, i had no issues.
Title: running on PHP 5.1.6..
Post by: Geeforce on August 10, 2009, 03:45:22 AM
Well, that depends on which repo's you use.
And I stick to the base!

But that was nog my question, I want what specific things from 5.2 are needed/used.
Title: running on PHP 5.1.6..
Post by: rosali on August 10, 2009, 04:16:22 AM
Please ask developers at mailing list (RoundCube Mailing Lists (http://lists.roundcube.net/dev)).
Title: running on PHP 5.1.6..
Post by: Geeforce on August 10, 2009, 04:36:41 AM
Quote from: rosali;20475Please ask developers at mailing list (RoundCube Mailing Lists (http://lists.roundcube.net/dev)).

Thanks will do!
Title: roundcubemail provided with the team CentOS
Post by: fakessh on October 19, 2009, 02:11:24 PM
the roundcubemail 0.1.1 depot EPEL does not work

What used php ?
stable depot vs c5-testing depot ...... :)

mymail ([email protected])
Title: running on PHP 5.1.6..
Post by: fretn on March 24, 2010, 09:23:54 AM
I'm running roundcube 0.3.1 on RHEL 5.4, this comes with a php 5.1.6 installation.
the only thing that's missing from that php version is the function json_encode.
somebody on php.net wrote a php implementation of this function, I added following code to program/include/rcube_shared.inc :

if (!function_exists('json_encode'))
{
  function json_encode($a=false)
  {
    if (is_null($a)) return 'null';
    if ($a === false) return 'false';
    if ($a === true) return 'true';
    if (is_scalar($a))
    {
      if (is_float($a))
      {
        // Always use "." for floats.
        return floatval(str_replace(",", ".", strval($a)));
      }

      if (is_string($a))
      {
        static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
        return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
      }
      else
        return $a;
    }
    $isList = true;
    for ($i = 0, reset($a); $i < count($a); $i++, next($a))
    {
      if (key($a) !== $i)
      {
        $isList = false;
        break;
      }
    }
    $result = array();
    if ($isList)
    {
      foreach ($a as $v) $result[] = json_encode($v);
      return '[' . join(',', $result) . ']';
    }
    else
    {
      foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
      return '{' . join(',', $result) . '}';
    }
  }
}


All that was left was changing the php version check in the installer installer/check.php :

from:
define('MIN_PHP_VERSION', '5.2.0');
to:
define('MIN_PHP_VERSION', '5.1.6');

And everything seems to work fine for me.
Title: Brilliant!
Post by: aenright on June 18, 2010, 05:30:19 PM
Just wanted to thank fretn for this post.  I have rc running on my RHEL 5.5 server now.

Thanks again,
-Art
Title: I spoke too soon :(
Post by: aenright on June 18, 2010, 06:46:32 PM
I am getting the following message in syslog:

roundcube: PHP Warning:  setcookie() expects at most 6 parameters, 7

Some quick googling leads me to believe that a seventh parameter was added in PHP v 5.2 (httponly), after grepping through the code, I don't easily see how to adjust the parameters sent when creating the cookie.  Has anyone experienced this issue to date?

Thanks,
-Art
Title: Update
Post by: aenright on June 18, 2010, 09:57:22 PM
I am running RoundCube version 0.4-beta.
Title: running on PHP 5.1.6..
Post by: fretn on June 21, 2010, 02:49:55 AM
just remove the last "true" from the parameters list


program/include/rcmail.php on line 1187:

//setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], rcube_https_check(), true);
setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], rcube_https_check());