Author Topic: running on PHP 5.1.6..  (Read 8222 times)

Offline Geeforce

  • Newbie
  • *
  • Posts: 6
running on PHP 5.1.6..
« 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.

Offline rwssoccer1

  • Newbie
  • *
  • Posts: 1
running on PHP 5.1.6..
« Reply #1 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.

Offline Geeforce

  • Newbie
  • *
  • Posts: 6
running on PHP 5.1.6..
« Reply #2 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.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
running on PHP 5.1.6..
« Reply #3 on: August 10, 2009, 04:16:22 AM »
Please ask developers at mailing list (RoundCube Mailing Lists).
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline Geeforce

  • Newbie
  • *
  • Posts: 6
running on PHP 5.1.6..
« Reply #4 on: August 10, 2009, 04:36:41 AM »
Quote from: rosali;20475
Please ask developers at mailing list (RoundCube Mailing Lists).


Thanks will do!

Offline fakessh

  • Newbie
  • *
  • Posts: 2
roundcubemail provided with the team CentOS
« Reply #5 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

Offline fretn

  • Newbie
  • *
  • Posts: 2
running on PHP 5.1.6..
« Reply #6 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 :

Code: [Select]
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:
Code: [Select]
define('MIN_PHP_VERSION', '5.2.0');
to:
Code: [Select]
define('MIN_PHP_VERSION', '5.1.6');

And everything seems to work fine for me.
« Last Edit: March 24, 2010, 09:26:50 AM by fretn »

Offline aenright

  • Newbie
  • *
  • Posts: 4
Brilliant!
« Reply #7 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

Offline aenright

  • Newbie
  • *
  • Posts: 4
I spoke too soon :(
« Reply #8 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

Offline aenright

  • Newbie
  • *
  • Posts: 4
Update
« Reply #9 on: June 18, 2010, 09:57:22 PM »
I am running RoundCube version 0.4-beta.

Offline fretn

  • Newbie
  • *
  • Posts: 2
running on PHP 5.1.6..
« Reply #10 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());