使用命令行界面(CLI)安装
From LimeSurvey Manual
简介
在进行自动化安装时(例如在虚拟机环境中),您可以充分利用 LimeSurvey 的 CLI(命令行界面,此处指 v2.x 版本)。用于此目的(以及重置密码)的文件位于 WEBROOT/application/commands 文件夹中,此处需要使用的是 console.php。
前提条件
- PHP CLI 必须可用
- WEBROOT/application/config/config.php 必须存在,并已填入自动化安装过程所提供的参数。
- 已启用的 PHP 模块及其权限应满足 LimeSurvey 的需求。
- 应创建一个空的 MySQL 数据库,并且用户应拥有使用该数据库的相应权限。
用法
为便于说明,在我们的示例中假定 WEBROOT 为 /var/www/limesurvey。
cd /var/www/limesurvey/application/commands
php console.php
将显示:
Yii command runner (based on Yii v1.1.14) Usage: console.php <command-name> [parameters...] The following commands are available: - install - message - migrate - plugin - resetpassword - shell - webapp To see the individual command help, use the following: console.php help <command-name>
语法
php console.php <Admin User Name> <Admin User Password> <Full Name> <EMail ID>
- 如果全名和密码包含空格或其他特殊字符,请用双引号将其括起来。
- 所有其他参数,如数据库名称、数据库类型、数据库用户、数据库密码等,必须在执行脚本之前填写到 config.php 文件中。
- 脚本只能在 WEBROOT/application/commands 文件夹中并从该文件夹执行。
示例
cd /var/www/limesurvey/application/commands
php console.php install limeadmin pwd123 Admin admin@mydomain.com
将输出以下文本:
/var/www/limesurvey/installer/sql/create-mysql.sql
此时数据库应已正确安装。