[How to] General Introduction and Installation of Limesurvey

If you don’t know what limesurvey is?
- Limesurvey is a great opensource survey application. It has been widely used by many big industries to create the survey tasks. It has many powerful features like creating dynamic fields for survey. Supports multilingual, defines userroles, user groups and the more it has been integrated into various CMS (drupal etc). The limesurvey team provides the commercial for those who are seeking.As well as community support for its users. Just to get the more details inside the limesurvey visit the http://www.limesurvey.org/

So, Here is basic guide on installing limesurvey.

At first download the limesurvey from http://www.limesurvey.org/en/download
Then click in the button where it says “Click here to download the latest version” (see the screenshot below)

Download latest limesurvey

When you click the link you get to a new page. From the new page click the file “limesurvey192-build120303.zip” or whichever link you think is suitable for you. I assume you know what these different files mean.

When the download is complete, extract the compressed file. You will get a new folder limesurvey. Copy this folder to the root of your document root or simply saying ‘htdocs’.

Now, here is the main configuration part for limesurvey.
- Open the limesurvey/config.php

and replace the following lines with appropriate settings

$databaselocation   =   'localhost';
$databasename       =   'limesurvey';
$databaseuser       =   'root';
$databasepass       =   '';
$dbprefix           =   'lime_';

$rooturl            =   "http://{$_SERVER['HTTP_HOST']}/ls";

// Installation Setup
$defaultuser        =   'admin';           // This is the username when LimeSurvey is installed and the administration user is created on installation
$defaultpass        =   'password';

In the above url, if your limesurvey folder is different than “limesurvey” as in my case it is “ls” then you also have to reflect that changes in $rooturl variable. To do that simply replace the name folder at the end of the $rooturl variable with newer one. see the line 7 in above code.

Then There is the installation setup which is admin username and password that will be used to login into the limesurvey admin page.

Now, Create a database named “limesurvey” or whichever you put into the config.php settings.

We are done with the settings. Now, we will have to populate the database with intial settings for limesurvey to operate. To do that visit the link

http://localhost/limesurvey/admin/install/

You’ll get a message as “A database named ‘limesurvey’ already exists. Do you want to populate that database now by creating the necessary tables.”.

It is fine we did that on purpose,right. This database is empty and now we will populate with necessary limesurvey tables.

see the screenshot below
Populate database

To do that, Just click in the “populate database”. This will take a moment.

When everything goes fine you will get a message as “Database `limesurvey` has been successfully populated.” as shown in screenshot below :

Successfull population of limesurvey database

Now if you click on the button “Main admin screen” you will get a error message stating that either you should delete or rename the install folder.

Rename install folder
Delete or rename the install folder. In Development environment, I usually rename the install folder.

  • -goto the limesurvey/admin folder
  • rename the “install” folder to the “old.install”

Now, we are done with limesurvey installation and it is ready for creating surveys.

To start the limesurvey administration visit the url http://localhost/limesurvey/admin/

Login to the limesurvey
To login to the limesurvey, use the username/password configured inside “config.php”.

I have tried to be as smooth as possible with the installation and forgive my English, i know its quite up and down. So that was all and if you are looking for more limesurvey tutorials drop some comments and I will try to be helpful as much as possible.

References :
1. Limesurvey Homepage, http://www.limesurvey.org/
2. Limesurvey Developer’s Wiki, http://docs.limesurvey.org/tiki-index.php?page=LimeSurvey%20Development&redirectpage=Development

Xampp : Session Error

Below are the error in php due to session. This happens usually when server is unable to save the sessions data temporarily due to the improper path settings in session.save_path = “\xampp\tmp”.
Solution is to set the session.savepath correctly to point to directory where server can find it easily.

Warning: session_start() [function.session-start]: open(\xampp\tmp\sess_nsvvoh9f5l55g063d7qka1lq72, O_RDWR) failed: No such file or directory (2) in D:\htdocs\bull_ext\access_control\main.inc on line 39

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\htdocs\bull_ext\access_control\main.inc:39) in D:\htdocs\bull_ext\access_control\main.inc on line 39

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\htdocs\bull_ext\access_control\main.inc:39) in D:\htdocs\bull_ext\access_control\main.inc on line 39

Warning: Cannot modify header information - headers already sent by (output started at D:\htdocs\bull_ext\access_control\main.inc:39) in D:\htdocs\bull3\framework\application.inc on line 589

This settings is stored inside the php.ini file, which can be found under c:\xampp\php\ directory.

First stop the Xampp Server.

session.save_path = "\xampp\tmp"

and change it to look like this

session.save_path = "C:\xampp\tmp"

Restart the Xampp Server. That’s it now your session should work as expected.

Hope this was useful for someone.

Using Eclipse IDE for PHP

I have already written an article describing how we can use Eclipse IDE for JAVA, Now I am going to show you how we can use the same Eclipse IDE for PHP.

All we have to do is download the plugins for Eclipse and then integrate it to JAVA’s IDE. For you I have compressed the plugins for PHP. Dowload Link

Once you have downloaded the compressed folder. Extract it. You will get a folder having name feature. Now, copy that folder and then paste it in the same directory of Eclipse. See the screen shot below, you’ll have exactly the same folder structure. There you will already have the folder features.

Eclipse Folder Structure

Eclipse Folder Structure

When asked to merge select Yes. Then you’ll have a PHP Perspective in Eclipse IDE.

Q. How to confirm if PHP has been enabled in Eclipse IDE ?

A. Start Eclipse IDE, then Click Window > Open Perspective > Other. Then you’ll get a window similar to the one below.

Open Perspective

Open Perspective

As you can see in the above window. The PHP and PHP Debug are listed. This confirms that we have successfully integrated the PHP Perspective into Eclipse JAVA IDE. Now you can use the same Eclipse IDE for PHP programming too, and all the syntax highlighting, auto completion for PHP will work as it would work for JAVA.

If you already have Eclipse IDE for PHP and want to integrate JAVA into it, then just follow the process but this time get plugins for JAVA and copy-paste into Eclipse PHP IDE. And to confirm follow the same process as above and see if JAVA and JAVA Debug is listed or not.

Have a nice day folks,
Asee

Unicode in PHP and MySql

While I was working with Nepali Unicode in PHP and MySql, I found difficulty in inserting Nepali into database. I made some explorations and found a way to deal with this.

There are some basic things you need to be careful when working with Unicode, especially with database.

The database itself should be encoded in UTF-8 format and whatever is the method to access that particular database, The programming language should be aware that the database is UTF-8 enocded.

The field to store Unicode text should also be changed to<Strong>utf8_general_ci</strong> under collations.

1. How to create database UTF-8 encoded.

a. Start Phpmyadmin, Then enter the database name

Under MySql Connection Collation select utf8_general_ci then hit create.

See the figure below

Database Encode

Database Encode

That