Actions

Installation FAQ

From LimeSurvey Manual

Revision as of 17:59, 26 February 2010 by C schmitz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Contents:

During Installation

How can I create a database and a user in mysql with command line access?

You have to enter the below commands in your mysql.

create database <your_database_name>;

create user <your_database_username>;

create user <your_database_username>@localhost;

set password for <your_database_username> = PASSWORD('<your_database_password>');

set password for <your_database_username>@localhost = PASSWORD('<your_database_password>');

grant all on <your_database_name>.* to '<your_database_username>';

grant all on <your_database_name>.* to '<your_database_username>'@'localhost';

You have to replace <your_database_name>, <your_database_username> and <your_database_password> in above commands with according values.

What if I can't create a database through a script?

Normally, the script creates a new database, and then the table structure. However if your server/ISP doesn't give you admin rights to create a new database in MySQL, you will need to contact your server administrator to create the necessary database (or create it yourself). They should create a blank database for you that gives you the appropriate access rights (ie: read/write/create). Enter the name of this database, and your user name and password in the config.php script, and run the /admin/install/index.php script. The script will then create the required tables in the database.

What permissions should I set?

The /limesurvey/tmp directory needs to be given read/write/execute access (chmod 777) - this directory is where all uploaded files, and temporary files are created. All other directories and files can be set to read/execute only (chmod 755).

What is this mbstring (Multibyte String Functions) library?

The mbstring library is a PHP library to be able to convert char sets from one language to another.  You need it if you want to run LimeSurvey. To check if it is already installed open the URL

 http://<your_server>/<your_limesurvey_directory>/admin/install/phpinfo.php

from the web browser. A lot of information will be shown. Search for the string 'mbstring' under the Configuration section.

If you find the mbstring section then all should be well and you can continue on with your LimeSurvey installation!

If you don't find the mbstring section you might have a problem on your hands.

There are three possible scenarios:

  • If it's your providers server: Ask your provider to activate that extension in PHP or how to activate it - if you have a good administration panel for your server you may be able to activate it yourself.
  • If it's your own Linux server: You may have to re-compile PHP and include the mbstring library. Ask the Linux experts how to do that. In most Linux versions today you can install it using your Linux packet manager.
    • If you are using a version of Linux that supports 'yum' (CentOS, RedHat, Fedora):
      1. Use the terminal (as a super user) and type: yum install php-mbstring
      2. Make sure to update /etc/php.ini to update and uncomment the various mbstring params
      3. Make sure to restart apache after installing it:  /etc/init.d/httpd restart
  • If it's your own Windows server: Search for php.ini on your system, open it with an editor and search for mbstring. Most probably the line that contains that string is commented out with a semicolon. Remove the semicolon, save and restart your web server.

When I am entering special chars (Chinese, Cyrillic, Greek, Arabic) into my survey, every character is shown as a question mark?

This happens if your database itself is not created to use an UTF-8 charset. This can happen when you have to create the database using a provider administration panel. You can fix this by executing the following SQL command on your database (using for example phpMyAdmin).

ALTER DATABASE `<your_database_name>` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Replace <your_database_name> with the name of your database. You need to do this before installing LimeSurvey.

Blank page when accessing the Install page

The problem is not with the LimeSurvey installation but with the PHP installation.

  • Verify you have the MySQL PHP module (php-mysql) installed.
  • Verify your PHP install is loading the PHP.ini file your are modifying and not parsing other PHP.INI files on your system.
  • Verify the location and permissions of the following setting in your PHP.ini
upload_tmp_dir="/temp"

session.save_path="/temp"

After Database Creation

Blank Page after Database Creation

Symptoms

  • LimeSurvey installed OK, and database was created, but instead of the admin page, you get an empty page
  • Web surver log shows "Fatal error: Call to a member function on a non-object in /path/to/limesurvey/admin/login_check.php on line 69"

Fix

This is probably an incorrect setting for $rooturl or $rootdir in config.php. In particular, config.php attempts to set $rootdir correctly by calling dirname('''FILE''') and while this usually works, it can be upset when LimeSurvey is installed in a user's home or public_html directory and the home directory is mounted over NFS. Try setting $rootdir manually, and in particular, while your shell or pwd command may show a path like "/disks/hostname/home/username/public_html/limesurvey", try using "/home/username/public_html/limesurvey".

When accessing admin page, the browser keeps running and will eventually fail to show it

Symptoms

  • LimeSurvey installed OK and database was created. But when you access the admin page, the browser keeps running and will eventually fail to show the page.
  • When you check the web server access log, its size has become so big (in some cases, more than 2 GB).
  • Inside the access log, you get this message filling the log.

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /limesurvey/classes/php-gettext/streams.php on line 120

Note: line number may be different depending on your LimeSurvey version.

Fix

This may be caused by the mbstring.func_overload setting. Check the setting in your php.ini and set as the following.

mbstring.func_overload = 0

Note: This means no function overloading. See PHP manual for this setting: Function Overloading Feature

When accessing admin page, the browser reports Fatal error: Call to a member function gT() on a non-object in login_check.php on line 76

Symptoms

  • LimeSurvey installed OK and database was created. But when rdirected to the admin page, the browser displayed the the listed error.
  • $rootdir and $rooturl are correctly set in config.php.
  • The disk path name for limesurvey installation directory includes one of the following characters: ()+

Note: Other characters may also induce the same behaviour

Fix

Move / rename the limesurvey installation directory so that pathname does not include either the ( or ) characters

After Login

Any action in admin page will return you to login screen

This may happen for the following two main reasons :

  • PHP sessions problems
  • UTF8 encoding problems

PHP Sessions :

  1. Update upload_tmp_dir and session.save_path in php.ini
  2. Create the configured session and upload directories
  3. IIS: Assigned permission to create and modify to IIS guest user account
  4. Apache: Make sure your webserver has permissions to write into the configured directory
  5. Check if the variable  "session.use_cookies" in php.ini is set to 1.
  6. Check the variable "session.auto_start" in php.ini. If it is set to 1, change it to 0.

UTF8 Encoding :

If you edit any file (most probably config.php) do not save it as UTF8 to support special language chars! Always save .php files as true ANSI/ISO format. Starting with 1.87 you can set the most important settings inside the application using the 'Global settings' dialog (like site name, administrator name, etc.).

I can't change the language!

No matter what language you choose, the interface (admin und user) always is in English language. Normally this is caused by a bug in your PHP version. Try setting the $translationmode parameter in config.php to '1' to activate a workaround for this bug.

Some common errors (IIS focused)

Index.php won't open

Possible cause: This might happen if you haven't installed necessary extensions

  • You need to install Multi-byte string, and MSSQL (or MySQL) extensions

Possible cause: ISAPI filter not configured

  • In IIS, for the website (you could do it at the directory level) you must configure it to use php5isapi.dll

Index.php won't open and "php.exe -i" gives error messages about missing .dll's

This may happen if you install too many extensions

  • If you install all PHP extensions, PHP will fail because not all dependencies were met (e.g. oracle package needs oracle dll's)
  • Install only the extensions that you need
  • To test, try running php.exe -i from the command line

Message stating database was missing

This may happen if you navigate to wrong url

  • Make sure you go to limesurvey/admin/install/index.php instead of limesurvey/index.php !

"Session expired" error message

This may happen if the system is under load and you do not increase the maximum memory usage

  • Edit config.php, alter / add $memorylimit =  "16M"; to something higher (e.g. 128M)

Another solution is to edit the index.php file to tell PHP which session setting should be used. You can try to add this code to line 22 of your index.php file:

ini_set('session.use_trans_sid', true);

ini_set('session.use_cookies', false);

This solution was provided by User "Adam". Thanks a lot!

Above fixes do not solve the problem

This may happen if you have not restarted IIS

  • Restart IIS

Things that were easy to forget:

  • .php needs to be associated to php5isapi.dll filter (It did this for me automagically)
  • limesurvey/tmp directory needs writer permission for survey uploads
  • updating doc_root in php.ini and $rootdir in config.php

FCKEditor won't load

FCKeditor can't be loaded and the following Error is displayed:

 Error loading "limesurvey/admin/scripts/fckeditor/fckstyles.xml"

This is due a a web server misconfiguration. Try adding the following line to your httpd.conf file (for Apache), or to your .htaccess file in your LimeSurvey directory (if you're not the web server administrator):

 AddType application/xml .xsl

Some have reported that given their Apache setup they had to use the following two lines instead:

 RemoveHandler .xml

 AddType application/xml .xml

Missing files ("No such file or directory")

When uploading LimeSurvey to your server it might happen that the connection is interrupted so that some files are not transferred or not transferred completely. Depending on the files you can receive error message at different part of LimeSurvey usage. Normally missing files throw errors like

"Warning: require_once(/path/to/your/limesurvey/installation/filename) [function.require-once]: failed to open stream: No such file or directory in /path/to/your/limesurvey/installation/filename on line 12345)" OR

"Fatal error: require_once() [function.require]: Failed opening required 'require_once(/path/to/your/limesurvey/installation/filename)' (include_path='.:/x/y/z) in /path/to/your/limesurvey/installation/filename on line 12345"

Solution

1. Delete all uploaded files.

2. Re-upload the files.

(3. If necessary: Re-install by browsing to /limesurveyfolder/admin/install)