0

We are using a VPS server in our company and I'm trying to install Roundcube webmail interface

But I can't even get to the configuration phase because the set_include_path function doesn't work and the script can't find the required configuration files.

I get an error like "Fatal Error, ini_set/set_include_path function does not work."

I assume some php settings is causing this but I don't which one.

I'd be glad if I could get some help.

Thanks in advance

//EDIT Here is the codes from the script

ini_set('error_reporting', E_ALL&~E_NOTICE);
ini_set('display_errors', 1);

define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');

$include_path  = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
$include_path .= INSTALL_PATH . 'program' . PATH_SEPARATOR;
$include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
$include_path .= ini_get('include_path');

set_include_path($include_path);

require_once 'utils.php';
require_once 'main.inc';
Onur Kucukkece
  • 1,708
  • 1
  • 20
  • 46
  • 1
    "Fatal Error, function does not work"? Please post the actual quoted error. – Madara's Ghost Dec 01 '11 at 14:21
  • 1
    I get "Fatal error: ini_set/set_include_path does not work." and in the installation folder I get "Warning: require_once(main.inc) [function.require-once]: failed to open stream: No such file or directory in /usr/share/psa-horde/installer/index.php on line 45" – Onur Kucukkece Dec 01 '11 at 14:26
  • See this bug: http://trac.roundcube.net/ticket/1484675 – Prisoner Dec 01 '11 at 14:31
  • Thanks but it didn't really help, the link isn't pointing to the related post. And at the bottom of the page it's written that's not a RoundCube bug. – Onur Kucukkece Dec 01 '11 at 14:44

1 Answers1

0

I'm doing this from memory, so it might not be quite right, but I think maybe you are confusing the path and directory separators. There may also be a nicer way to do this than what you are doing (i.e. assembling the whole path at once). Try something like this:

define('INSTALL_PATH', dirname(dirname(__FILE__)));

set_include_path(get_include_path() . PATH_SEPARATOR . INSTALL_PATH . DIRECTORY_SEPARATOR . 'program' . DIRECTORY_SEPARATOR . 'lib'); set_include_path(get_include_path() . PATH_SEPARATOR . INSTALL_PATH . DIRECTORY_SEPARATOR . 'program' . DIRECTORY_SEPARATOR . 'include'); set_include_path(get_include_path() . PATH_SEPARATOR . INSTALL_PATH . DIRECTORY_SEPARATOR . 'program');

Usually I compress this a little bit with implode, since DIRECTORY_SEPARATOR is so verbose:

...PATH_SEPARATOR . implode(DIRECTORY_SEPARATOR, Array(INSTALL_PATH, 'program', 'lib'));

I think by (most importantly) changing some of your PATHs to DIRECTORYs, and (possibly) using incremental get_include_path and set_include_path calls, it will be more readable, portable and just might work properly.

Josh
  • 6,944
  • 8
  • 41
  • 64