Configuration

In Blueshield there are no much to configure. only you have to configure very few configuration options.

Base URL

To set Base URL in config.php file, follow step by step bellow instructions.

  1. Open config.php under application/config directory.
  2. Find $config['base_url'] = ''; and set it with your base URL. e.i. if you are installed Blueshield on localhost then it should be like $config['base_url'] = 'http://localhost/blueshield/';, if you are installed Blueshield on remote host with your own domain, then it will be like $config['base_url'] = 'http://www.example.com/';

Localhost example

localhost base url

Remotehost example

remotehost base url

.HTACCESS compatibility

.HTACCESS support in your webhost is optional for Blueshield thats mean Blueshield can run with or without .HTACCESS support. but you have to configure that is config.php file.

If .HTACCESS support in your webhost

If your webhost support for .HTACCESS, then you dont have to do any configurations in config.php file.

If .HTACCESS not support in your webhost

If your webhost not support for .HTACCESS, then simply set $config['index_page'] = ''; configuration item like $config['index_page'] = 'index.php/'; in config.php file.

index page

Database configuration

After you create a brand new database for Blueshield app and import blueshield.sql file. you have to do some configurations in database.php file under application/config directory.

database config file

These are the database configurations you have to do.

	
$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
	'dsn'	=> '',
	'hostname' => 'localhost',
	'username' => 'root',
	'password' => '',
	'database' => 'blueshield',
	'dbdriver' => 'mysqli',
	'dbprefix' => '',
	'pconnect' => FALSE,
	'db_debug' => (ENVIRONMENT !== 'production'),
	'cache_on' => FALSE,
	'cachedir' => '',

	/**
	 * Don't change this if in doubt.
	 * Default: utf8. priority no 01: utf8mb4. utf8mb4 gives better unicode support than utf8.
	 * 
	 * If your MySQL version is bellow v5.5.3, Then char_set "utf8mb4" will not work and can throw some errors
	 * like, "500 Internal Server Error". Then you should change current char_set from "utf8mb4" to "utf8".
	 */
	'char_set' => 'utf8mb4',

	/**
	 * Don't change this if in doubt.
	 * Default: utf8_general_ci. priority no 01: utf8mb4_unicode_520_ci. priority no 02: utf8mb4_unicode_ci.
	 *
	 * Setting "dbcollat" is optional. But due to different version of MySQL can occur some errors like, 
	 * database collation conflict errors, internal server errors. If you are getting those kind of errors,
	 * then you can setting up "dbcollat". To do that follow bellow instructions.
	 *
	 * If your MySQL version is bellow v5.5.3 and "char_set" is "utf8", Then you can try setting "dbcollat" as
	 * "utf8_general_ci". for e.i: 'dbcollat' => 'utf8_general_ci'.
	 *
	 * If your MySQL version is v5.5.3 or above v5.5.3 and "char_set" is "utf8mb4", Then you can try setting "dbcollat" as
	 * "utf8mb4_unicode_520_ci" (Newer version and recommended) or "utf8mb4_unicode_ci". for e.i: 'dbcollat' => 'utf8mb4_unicode_520_ci',
	 * 'dbcollat' => 'utf8mb4_unicode_ci'.
	 */
	'dbcollat' => '',
	'swap_pre' => '',
	'encrypt' => FALSE,
	'compress' => FALSE,
	'stricton' => FALSE,
	'failover' => array(),
	'save_queries' => TRUE
);
	

Dont freak out! you dont have to configure all those database configurations. only you have to configure is few of them. please check the bellow image.

db configurations

Email configuration

By default Blueshield comes with default email configurations. so most of the time email should work without any additional configurations. but sometimes you may need to change your email configurations. so dont worry it's pretty easy. let's see how we can do that.

There is a email configuration file called email.php sitting inside application/config directory. openup that file in your text editor. email config file And setup necessary email configuration in that email array. you can get all the available email configurations from here.

Google reCAPTCHA configuration

Setting up Google reCAPTCHA is pretty eassy. simply followup bellow step by step instructions.

  1. Go to this website.
  2. Click on sign up for an API key pair link.
  3. Under Register a new site section put your label and domains and hit the register button. google recaptcha register new site
  4. And the Google will give you Site key and Secret key for your domain. recaptcha site and secret keys
  5. There is a Google reCAPTCHA configuration file called recaptcha.php sitting inside application/config directory. openup that file in your text editor. recaptcha config file
  6. Set your domain Site key and Secret key like in bellow image. and save the file. recaptcha configurations in recaptcha confi file

Default language configuration

By default in Blueshield default language set to en-US. but you can change it by simply editing single line of code in config.php file sitting inside application/config directory.

config php file

Simply set your default language code like in bellow image. make sure there is a language directory inside application/language directory, that has same name of default language code. and save the config.php file.

language configuration item in config php file

Common errors and how to fix them

Due to so many different server environments and miss configuration of Blueshield app, some errors can occur. but don't be worry. we can fix them all.

  1. 500 Internal Server Error

    500 internal server error

    If you are getting this kind of error. then please follow bellow instructions in order to fix this error.

    1. Don't add this kind of unnecessary spaces in all configurations (Specially in database configurations). db configuration wrong and correct way
    2. Make sure all database configurations are correct. some database configurations can be found in your web hosting controle panel. for e.i: hostname, username, databse name and etc...
    3. If your MySQL version is bellow v5.5.3, Then database char_set "utf8mb4" will not work and can throw some errors like this. You should change current char_set from "utf8mb4" to "utf8". and use utf8 database .sql files in Blueshield package.
    4. Setting "dbcollat" database configuration is optional. but due to different version of MySQL can occur some errors like, database collation conflict errors, internal server errors and etc...

      If your MySQL version is bellow v5.5.3 and "char_set" is "utf8", Then you can try setting "dbcollat" as "utf8_general_ci". for e.i: 'dbcollat' => 'utf8_general_ci'.

      If your MySQL version is v5.5.3 or above v5.5.3 and "char_set" is "utf8mb4", Then you can try setting "dbcollat" as "utf8mb4_unicode_520_ci" (Newer version and recommended) or "utf8mb4_unicode_ci". for e.i: 'dbcollat' => 'utf8mb4_unicode_520_ci', 'dbcollat' => 'utf8mb4_unicode_ci'.

    5. Make sure your web server support for .HTACCESS files. if your web server not support for .HTACCESS files, then simply delete .HTACCESS file sitting inside app root directory. and configure $config['index_page'] configuration in config.php file sitting inside [app root]/application/config directory. to get more information about how to configure Blueshield app to run without .HTACCESS support can be found here.

Still if you are getting some errors, don't be worry or feel bad. we are here to help you. please contact us any time at scriptseries.com@gmail.com. we will reply soon as possible with detailed instructions.