Recent Changes - Search:



Wiki help.

Configuring the user-options in v0.9

This page supplements the documentation in the config.sample.php file. In case of conflict, the documentation in the latest version of config.sample.php is the correct version.

When upgrading your gtd-php installation, always check for new entries in config.sample.php, and if there are any, copy the new lines into your own note that the filename has changed from v0.8: it used to be config.php.

PHP Settings

You must have register_globals set to OFF. You can do this either in the php.ini file (which will affect your entire PHP setup), or in your .htaccess file that's in your gtd-php directory (which will affect only your gtd-php installation). If you get a message along the lines of:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near at line NN

then you probably have register_globals set to ON. In the .htaccess file in your gtd-php directory, add the line:

php_flag register_globals off

or in your php.ini file,

register_globals = Off

Database settings

Some entries are specific to the mysql installation. The hostname, database name, MySQL user name and MySQL password will probably be the same as your previous GTD-PHP installation. If you're installing anew, rather than upgrading, the MySQL information will probably have been determined when you installed MySQL.

 $config = array(
"host"   => 'localhost', : the hostname of your database server
"db"     => '',          : the name of your database
"prefix" => 'gtdphp_',   : the GTD table prefix for your installation (optional)
"user"   => '',          : username for database access
"pass"   => '',          : database password
"dbtype" => 'mysql',     : database type: currently only mysql is valid.  DO NOT CHANGE!
"charset"=> 'UTF8'       : you only need this line if you are using the UTF-8 character set

The new entry in this first section is the prefix. This allows you to have more than one GTD-PHP installation in a single MySQL database, and also allows you to avoid any collisions between tables for this programme, and any other.

The prefix will be used on each table: so, for example, if you use the default prefix gtdphp_, then each table in the installation will start with gtdphp_; e.g. the preferences table will be called gtdphp_preferences. We recommend that you do not use capital letters in the prefix: you can use letters, numbers, underscore(_) and hyphen(-).

Only set charset to UTF8 if you are using UTF-8; in that case, follow the additional instructions below too. Do not set it otherwise.

All other options are now configurable via the Configure > User Preferences screen.

UTF-8 International Character set

If you are going to use UTF-8, then you will need some extra settings for the multi-byte encoding. Ensure that the UTF8 charset line is set as above in your file. Then go to the page Configure > User Preferences and in the Advanced section set PHP name of character set to UTF-8

PHP config for UTF-8

In the .htaccess file in your gtd-php directory, add the line:

php_value mbstring.http_input UTF-8,ASCII
php_value mbstring.detect_order UTF-8,ASCII
php_value mbstring.func_overload 6

or in your php.ini file,

mbstring.http_input = UTF-8,ASCII
mbstring.detect_order = UTF-8,ASCII
mbstring.func_overload = 6

Also check that you have the mbstring extension activated: this should show up in phpinfo(), and in your php.ini file you should find something along the lines of:


(this is for Windows installations - other operating systems may have similar lines to activate extensions)

Documentation Advanced Topics Configuration Version09

Edit - History - Print - Recent Changes - Search
Page last modified on October 16, 2008, at 03:11 AM