我需要在WAMP环境中设置Concerto平台来开发自适应测试。Concerto平台的链接在这里http://code.google.com/p/concerto-platform
这就是我所做的:1) 设置WAMP web服务器2) 设置R语言3) 设置localhost并检查php、mysql和R.的工作情况
现在我在Concerto的设置过程中遇到了一些问题,特别是在本安装指南的倒数第二个步骤6之后../concerto平台/wiki/installation3
Concerto设置成功地执行了php和mysql数据库的创建。此后,Concerto安装程序在按照下载安装中的建议运行安装脚本时无法识别R版本/concerto平台/下载/列表(zip文件3.8MB)
我已经将Concerto源安装zip文件的内容提取到"C:/wampp/htdocs/Concerto"目录中,安装脚本index.php位于"C:/wampp/htdocs/Concerto/setup/"子目录中。
当我从浏览器(localhost/conconcert/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;
}
我的预感是,由于我在start>run"Cmd/c G:/R/R-2.14.0/bin/Rscript.exe"--version-e 1+1中执行了等效的cmdline调用,所以exec函数在某种程度上并不完美。我可以手动进行结果检查,但不能通过上述设置函数进行检查。我向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环境中运行快速协奏曲安装中获得的任何想法和想法。我自己在WinXP上运行这个。也许有人可以就这个话题提出一些解决办法(如果exec确实是罪魁祸首的话,可以围绕exec())。
非常感谢!
我有同样的配置,它对我来说很好。首先,我建议你用R2.12而不是R2.14。你可以在这里买到http://cran.r-project.org/bin/windows/base/old/2.12.1/
我还建议您通过更改";R连接";部分添加以下行
//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时,您必须进行一些更改。
希望它能帮助你。
Ghost