LimeSurvey 1.01


Notes on how to install and run LimeSurvey v1.01 stable in Ubuntu Feisty. You can see a summary of LimeSurvey features in SurveyTools.

It is assumed that you are working in the machine running the webserver, and that you have can get root privileges with sudo.

Otherwise, if you don't have root privileges in the server machine, then you need somebody with privileges to do the requirements install and configuration for you (Apache, PHP, MySQL). You also need somebody with privileges to create the MySQL database for you. Even without root privileges, you can still install and configure LimeSurvey in your home directory yourself.

If you are using a hosting service, then URLs will not be based on localhost, but on something different, e.g., and you will need to check with them whether their installed software fulfills the requirements.


The requirements for LimeSurvey are:


Step-by-step notes on how to install Apache, PHP and MySQL in Ubuntu Feisty can be found in the Apache section of the Unofficial Ubuntu Feisty guide. In short:

For Apache v2.2, mbstring, PHP v5.2, MySQL v5.0, PHP5-MySQL (the module that allows PHP scripts connect to MySQL databases) and Web administration of MySQL

$ sudo apt-get install apache2 libapache2-mod-php5 php5 mysql-server-5.0 php5-mysql phpmyadmin

For the GD and LDAP PHP modules

$ sudo apt-get install libgd2-xpm php5-gd php5-ldap

For LimeSurvey, download the file and unzip it to a directory that is visible to the webserver, e.g.

$ mkdir -p ~/public_html/
$ unzip -d ~/public_html/limesurvey
$ chmod 755 -R  ~/public_html/limesurvey
$ chmod 777 ~/public_html/limesurvey/tmp

Configuration of requirements


Set a root password for MySQL if you haven't yet (taken from How to install MYQSL Database Server)

$ mysqladmin -u root password your-new-password
$ sudo /etc/init.d/mysql restart

where your-new-password should be replaced by the password you want.

Open the URL http://localhost/phpmyadmin in a browser, login as root and go to "Privileges" -> "Add a new user". Create a new user and database:

Username: phpsurveyor
Host: localhost
Password: <password-for-limesurvey>
Re-type:  <password-for-limesurvey>

* Create database with same name and grant all privileges

Still using the web interface, go to "Databases" -> "phpsurveyor" -> "Operations" and if necessary, change "Collation" to



Activate the PHP MySQL module by editing /etc/php5/apache2/php.ini and commenting out the corresponding line so that it looks like

Restart the Apache server

$ sudo /etc/init.d/apache2 restart

If you want to access LimeSurvey from another computer, then you need to edit /etc/apache2/sites-available/default and replace

DocumentRoot /var/www/


DocumentRoot /home/<username>/public_html/

where <username> is your user name in the machine where Apache is running. Replace also

<Directory /var/www/>


<Directory /home/<username>/public_html/>

Then restart the server

$ sudo /etc/init.d/apache2 restart

Testing of requirements

Open the URL http://localhost/ in a browser and check that you don't get any errors from the Apache server. If you open the URL http://localhost/ and everything is fine, you should see your root web directory.

If you didn't change DocumentRoot in the configuration section above, then you will see an apache2-default directory. If you click on it, a white page with big black letters that say "It works!" will appear. If you changed it to /home/<username>/public_html, then you will see whatever is in your /home/<username>/public_html directory.

Open the URL http://localhost/phpmyadmin in a browser and check that you can login as root with the your-new-password you set before. If there are no errors, MySQL and PHP and related modules are correctly installed.

Open the URL http://localhost/~<username>/ with a browser, replacing <username> by your Ubuntu user name. If there are no errors with the installation and configuration, you should see the directory limesurvey that you created in the installation stage in ~/public_html.

Configuration of LimeSurvey

Edit the file ~/public_html/limesurvey/config.php, and modify the corresponding fields to look like

$databaselocation   =   "localhost";
$databaseport       =   "3306";
$databasename       =   "phpsurveyor";
$databaseuser       =   "phpsurveyor";
$databasepass       =   "<password-for-limesurvey>";

$rooturl            =   "http://localhost/~<username>/limesurvey";

Open http://localhost/~<username>/limesurvey/admin/admin.php in a browser. You will get the error

It appears as if some tables or fields are missing from your database.

Click the "Check Database Fields" button to create the missing tables. Then check the new page in the browser to see that all tables have been correctly created, and click the "Main Admin Screen" button. This will take you to the URL http://localhost/~<username>/limesurvey/admin/admin.php. Note that the application is still called by its previous name, "PHPSurveyor" instead of "LimeSurvey".

Make the limesurey/admin directory temporarily writable by all

$ chmod a+w ~/public_html/limesurvey/admin

Click on "Activate Security", and you will be shown the following message


You have not yet initialised security settings for your survey system and subsequently there are no restrictions on access.
If you click on the 'initialise security' button below, standard APACHE security settings will be added to the administration directory of this script. You will then need to use the default access username and password to access the administration and data entry scripts.

User name: admin
Password: password

It is highly recommended that once your security system has been initialised you change this default password.

Click on the "Initialise Security" button. You will get the message

Creating default users
"/usr/bin/htpasswd" -bc .htpasswd admin password 2>&1

Updating users table


Make the limesurvey/admin directory only writable by the owner again

$ chmod 755 admin

Note that now you have the Apache security access files in limesurvey/admin

$ ls admin/.ht*
admin/.htaccess  admin/.htpasswd

Click on "Continue" in the browser, and an "Authentication Required" window will appear. Enter

Username: admin
Password: password

and you will be back to the !LimeSurvey/PHPSurveyor Administrator interface. Click on the "Edit" button to change the admin password (you will need to authenticate yourself again).

More information is available from the English Instructions for LimeSurvey, but note that the online manual is for the unstable version. A manual for v1.01 can be found in your local install of LimeSurvey, e.g. http://localhost/~<username>/limesurvey/admin/lang/english/instructions.html.

Using LimeSurvey

This is system independent, so please refer to the English Instructions for LimeSurvey or manual in your local install, e.g. http://localhost/~<username>/limesurvey/admin/lang/english/instructions.html.

Upgrading from LimeSurvey 1.01 to LimeSurvey 1.52+ build 3304 2007-09-20


Notes on how to install and run LimeSurvey 1.52+ build 3304 2007-09-20 in Ubuntu Feisty, assuming that LimeSurvey 1.01 was already installed in the system. These notes are probably valid for other Linux distributions and LimeSurvey 1.52 versions.

It is not possible to actually upgrade from v1.01 to 1.52, so in fact a new installation needs to be made. Hence we mainly follow the English Instructions for LimeSurvey.


From the file limesurvey/docs/release_notes_and_upgrade_instructions.txt that comes in the download package:


It is assumed that you have installed and configured Apache, MySQL and PHP as described above, and that your old installation of LimeSurvey is in ~/public_html/limesurvey.

Rename the old limesurvey directory

$ cd ~/public_html
$ mv limesurvey limesurvey-1.01

For LimeSurvey, download the latest LimeSurvey 1.52+ tarball, and untar it to obtain the new limesurvey directory

$ tar xvzf limesurvey152+_build3304_20070920.tar.gz
$ chmod 755 -R  limesurvey
$ chmod 777 limesurvey/tmp

Configuration of LimeSurvey

Open the URL http://localhost/phpmyadmin in a browser, login as root and go to "Privileges" -> "Add a new user". Create a new user and database:

Username: limesurvey
Host: localhost
Password: <password-for-limesurvey>
Re-type:  <password-for-limesurvey>

* Create database with same name and grant all privileges

Still using the web interface, go to "Databases" -> "limesurvey" -> "Operations" and if necessary, change "Collation" to


Edit the file ~/public_html/limesurvey/config.php, and check that the following fields have these values

$databasetype       =   "mysql";
$databaselocation   =   "localhost";
$databaseport       =   "default";
$databasename       =   "limesurvey";
$databaseuser       =   "limesurvey";
$databasepass       =   "<password-for-limesurvey>";

$rooturl            =   "http://{$_SERVER['SERVER_NAME']}/~<username>/limesurvey";

Open http://localhost/~<username>/limesurvey/admin/admin.php in a browser. You will get the error

The LimeSurvey database does exist but it seems to be empty. Please run the install script to create the necessary tables.

Click on the link "install script". The browser will show the message

A database named "limesurvey" already exists.

Do you want to populate that database now by creating the necessary tables?

Click on the "Populate Database" button. The browser will show the message

Database `limesurvey` has been successfully populated.

Click on the Admin screen button. The browser will show the message

Everything is fine - you just forgot to delete or rename your LimeSurvey installation directory (/admin/install).
Please do so since it may be a security risk.

Delete the /admin/install directory

$ rm -r limesurvey/admin/install

Open in a browser http://localhost/~<username>/limesurvey/admin/admin.php. Login using the credentials

user: admin
password: password

You should see the LimeSurvey administration screen on the browser. Click con "Create/Edit Users", and click on the "Edit User" button for username admin. Edit the email address, full name and password to your own (the password doesn't have to be the same you used before for the database). Click on the "Update" button to save your changes.

Log out and log in again as admin with the new password.

Write permissions

To be able to e.g. import a CSV file of tokens, the web server needs to have writing access to directories

Otherwise, you will get an error like "Error: Upload file not found. Check your permissions and path for the upload directory".

Assuming that you are using the Apache webserver in Ubuntu, this error can be avoided by making those directories of the same group as the web server (www-data)

$ sudo chgrp www-data tmp admin templates

and then giving writing permission to everybody in the group www-data

chmod 775 tmp admin templates

Importing old surveys

To import old surveys, first you need to have exported them as SQL files. If you haven't, then we need to use the old LimeSurvey v1.01 again. For this to work, first make a backup copy of the new installation, and replace it by the old one

$ mv limesurvey limesurvey-new
$ cp -R limesurvey-1.01 limesurvey

Open in a browser http://localhost/~rcasero/limesurvey/admin/admin.php. You will be asked for your username and password. If for some reason you cannot remember them, then delete or rename limesurvey/admin/.htpasswd and limesurvey/admin/.htaccess to workaround security.

Once in the old administration web interface, select the database you want to export on the right hand menu. Click on the icon "Export this survey". The survey will be saved as a .sql file.

Repeat for all surveys.

Now we can get rid of the duplicated old limesurvey directory and replace it by the new limesurve install

$ rm -r limesurvey
$ mv limesurvey-new limesurvey

Open http://localhost/~rcasero/limesurvey/admin/admin.php in a browser to get to the new admin web interface.

Click on "Create or Import new survey". Go to the bottom of the page, where it says "Import Survey". Select the .sql file you want to import and click on the "Import Survey" button, and you should see a screen like this:

Import Survey
File upload succeeded.

Reading file..


Survey Import Summary

    * Surveys: 1
    * Groups: 1
    * Questions: 2
    * Answers: 2
    * Conditions: 0
    * Label Sets: 0 (Labels: 0)
    * Question Attributes: 0
    * Assessments: 0

Import of Survey is completed.

Deleting old database

Once you have imported your old surveys, you can get rid of the old database (no need for duplicate data).

Open http://localhost/phpmyadmin/ in a browser, and log in as root. Select the phpsurveyor database from the left hand side menu, and click on "Drop" to delete the old phpsurveyor database.

OSSWatchWiki: LimeSurveyInUbuntu (last edited 2013-04-15 13:56:21 by localhost)

Creative Commons License
The content of this wiki is licensed under the Creative Commons Attribution-ShareAlike 2.0 England & Wales Licence.

OSS Watch is funded by the Joint Information Systems Committee (JISC) and is situated within the Research Technologies Service (RTS) of the University of Oxford.