Actions

Installation using a command line interface (CLI): Difference between revisions

From LimeSurvey Manual

No edit summary
mNo edit summary
Line 8: Line 8:
* PHP CLI should be available
* PHP CLI should be available
* '''WEBROOT/application/config/config.php''' should be available and populated with the automated install's parameters.
* '''WEBROOT/application/config/config.php''' should be available and populated with the automated install's parameters.
* The availablity of the PHP Modules permissions availability should match '''LimeSurvey''' needs.
* The availablity of the PHP Modules permissions should match '''LimeSurvey''' needs.
* Empty MySQL database should be created and the database use user should be properly privileged for it.
* Empty MySQL database should be created and the database use user should be properly privileged for it.



Revision as of 11:25, 7 August 2017

Introduction

When doing automated installs (e.g. in a Virtual Machine setup), we can use use LimeSurvey's (v2.x referred to here) CLI (Command Line interface) to good effect. The files used for this purpose (and for resetting passwords as well) are in the WEBROOT/application/commands folder, the one of interest here being console.php.

Pre-requisites

  • PHP CLI should be available
  • WEBROOT/application/config/config.php should be available and populated with the automated install's parameters.
  • The availablity of the PHP Modules permissions should match LimeSurvey needs.
  • Empty MySQL database should be created and the database use user should be properly privileged for it.

Usage

For illustration purposes, we assume in our example the WEBROOT to be /var/www/limesurvey.

cd /var/www/limesurvey/application/commands
php console.php

This will show:

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 individual command help, use the following:
   console.php help <command-name>

Syntax

php console.php <Admin User Name> <Admin User Password> <Full Name> <EMail ID>
  • The Full Name and Password are enclosed in double quotes if they contain spaces or other special characters.
  • All other parameters like DB Name, DB Type, DB User, DB Password, etc are to be populated in the config.php file before script execution.
  • The script should be executed from and in the WEBROOT/application/commands folder only.

Example

cd /var/www/limesurvey/application/commands
php console.php install limeadmin pwd123 Admin admin@mydomain.com

outputs the following text:

/var/www/limesurvey/installer/sql/create-mysql.sql

and the database should be properly installed at the moment.