1

我需要在 WAMP 环境中设置 Concerto 平台来开发自适应测试。Concerto 平台的链接在这里http://code.google.com/p/concerto-platform

这就是我所做的:1)设置 WAMP 网络服务器 2)设置 R 语言 3)设置本地主机并检查 php、mysql 和 R 的工作。

现在我在安装 Concerto 的过程中遇到了问题,特别是在本安装指南的倒数第二步 ../concerto-platform/wiki/installation3 之后

Concerto 设置成功地执行了 php 和 mysql 数据库的创建。此后,Concerto 安装程序在运行安装脚本时无法识别 R 版本,如安装下载 ../concerto-platform/downloads/list(zip 文件 3.8 MB)中的建议

我已将 Concerto 源安装 zip 文件的内容提取到“C:/wampp/htdocs/concerto”目录,并且设置脚本 index.php 位于“C:/wampp/htdocs/concerto/setup/”子目录中.

当我从浏览器 (localhost/concerto/setup/index.php) 运行设置脚本时,我收到以下错误。“注意:第 97 行 C:\wampp\htdocs\concerto\setup\index.php 中未定义的偏移量 0。R 版本安装必须至少为 R >= v2.12。您的 R 版本为 :v”

它无法获取和显示安装的 R 版本,实际上是 R v2.14 当我检查 line97 和引用的 php 函数时,我注意到以下代码片段。

public static function rscript_check()
{
    $array = array();
    $return = 0;
    exec("'" . Ini::$path_r_script . "' -e 1+1", $array, $return);
    return ($return == 0);
}

public static function r_version_check($version)
{
    $elems = explode(".", $version);
    if($elems[0]>2) return true;
    if($elems[0]==2)
    {
        if($elems[1]>=12) return true;
    }
    return false;
}

public static function get_r_version()
{
    $output = array();
    $return = 0;
    exec("'" . Ini::$path_r_script . "' --version -e 1+1", $output, $return);
    $version = substr($output[0],10);
    $version = substr($version,0,  strpos($version, " "));
    echo $version;
    return $version;
}

我的预感是 exec 函数无法正常工作,因为我在 start > run "Cmd /c G:/R/R-2.14.0/bin/Rscript.exe" --version -e 中执行了等效的 cmdline 调用1+1" 并且能够手动检查结果,但不能通过上述设置功能。我询问了 Concerto 管理员,最近才开设了一个新的讨论论坛http://www.psychometrics.cam.ac。 uk/page/343/discussion-forum.htm

因此,我在这里向 SO 社区寻求帮助。非常感谢任何设置此安装的指针。PS:这里是我在 zip 文件中提供的 settings.php 文件中输入的设置

 >{phpstart

 >    //MySQL
->$db_host = "localhost";
->$db_port = "3306";
->$db_user = "root";
->$db_password = "";
->$db_name = "test";

 >//paths
->$path_external = "http://localhost/concerto"; //e.g. http://domain.com/concerto/
->$path_r_script = "G:/Program Files/R/R-2.14.0/bin/Rscript.exe"; //e.g. /usr/bin/Rscript
->$path_r_exe = "G:/Program Files/R/R-2.14.0/bin/R.exe"; //e.g. /usr/bin/R
->$path_php_exe = "C:/wampp/php"; //e.g. /usr/bin/php
->$path_mysql_home = "C:/wampp/mysql/bin"; //Home directory of MySQL server. It will be probably needed if you want to install Concerto on Windows platform. e.g. C:/Program Files/MySQL/MySQL Server 5.5
->$path_sock = "C:/wampp/htdocs/concerto/socks/"; //leave blank for default - /[concerto_installation_path]/socks/
->$path_temp = "C:/wampp/htdocs/concerto/temp/"; //leave blank for default - /[concerto_installation_path]/temp/

 >//R connection
->$r_instances_persistant = true; //true  - R instances are persistant and open throughout the whole test ( faster, but consumes more system resources, EXPERIMENTAL ), false - R instances are closed and restored when needed ( slower, but consumes less system resources )                           
->$r_instances_persistant_instance_timeout = 300; //after set period of instance inactivity in seconds the instance will be closed
->$r_instances_persistant_server_timeout = 420; //after set period of server inactivity in seconds the server will be closed ( new instances can restart it anytime )
->$r_max_execution_time = 120; //maximum R execution time ( prevents infinite loops in R on server )

 >//general
->$timezone = 'Europe/London';
 ->$public_registration = false;
 ->$public_registration_default_UserType_id = 4;

  >//remote client
  ->$remote_client_password = "pass";

  ->//ALWAYS RUN /setup AFTER CHANGING SETTINGS IN THIS FILE!
 ->?}phpend

我将感谢您从您的个人经验或在您的 WAMP/LAMP 环境中运行快速协奏曲安装的任何想法和想法。我自己在 Win XP 上运行它。也许有人可以就这个主题提出一些解决方法(如果 exec 确实是罪魁祸首,则围绕 exec() )。

十分感谢!

4

1 回答 1

0

我有相同的配置,对我来说效果很好。首先,我建议你使用 R2.12 而不是 R2.14,你可以在这里获得它http://cran.r-project.org/bin/windows/base/old/2.12.1/

我还建议您通过更改“R 连接”部分来更改 SETTINGS.php 文件。添加以下行

//R connection
$server_socks_type = "TCP"; // UNIX or TCP, choose TCP for any other OS than Linux
$server_host = "127.0.0.1"; //is socket server set to TCP, choose host to connect to
$server_port = "80"; //if socket server set to TCP, choose port used for connection
$r_instances_persistant_instance_timeout = 300; //after set period of instance inactivity in seconds the instance will be closed
$r_instances_persistant_server_timeout = 420; //after set period of server inactivity in seconds the server will be closed ( new instances can restart it anytime )
$r_max_execution_time = 30; //maximum R execution time ( prevents infinite loops in R on server )
$unix_locale = ""; //Unix locale LANG variable. Must be installed on the system. Leave blank for none/default.

当您使用 WAMP 时,您必须进行一些更改。

希望它会帮助你。

于 2013-05-28T06:41:20.143 回答