-
Notifications
You must be signed in to change notification settings - Fork 7
Config File
RedDragonWebDesign edited this page Sep 5, 2020
·
1 revision
There may be times you don't want to use the installer, and you'd like to generate your own config file. Here is the code and some tips.
Name: _config.php (don't forget the underscore)
Location: root directory
<?php
$dbhost = ""; // Examples: localhost, mysql.yourdomain.com
$dbuser = "";
$dbpass = "";
$dbname = "";
$dbprefix = ""; // Strongly recommend leaving this blank. Exception: You only have access to 1 SQL database, and you need to put tables for multiple engines in the same database. For example: WordPress and BlueThrust. Then give each engine a unique prefix.
$MAIN_ROOT = "/BlueThrust5/";
$BASE_DIRECTORY = "/home/cPanelName/public_html/BlueThrust5/";
$ADMIN_KEY = ""; // Admin pin number. Used as a 2nd password for certain dangerous actions.
define("ADMIN_KEY", $ADMIN_KEY);
This can be tricky to get right if you are not using the installer.
Always use forward slashes, even on Windows.
In general, both the beginning and end should have a slash. Exception: C:/ D:/
$MAIN_ROOT = "/BlueThrust5/";
$BASE_DIRECTORY = "/home/dreamhostAccountName/domainName.com/BlueThrust5/";
$MAIN_ROOT = "/BlueThrust5/";
$BASE_DIRECTORY = "/home/cPanelName/public_html/BlueThrust5/";
BASE_DIRECTORY needs to be the directory path, with forward slashes not back slashes, of where you have your Apache DocumentRoot set to, then add on the main root.
$MAIN_ROOT = "/BlueThrust5/src/";
$BASE_DIRECTORY = "D:/Dropbox/Code/BlueThrust5/src/";
Try running this PHP script. Name it test.php and place it in the root directory of the BlueThrust 5 scripts. View it and copy what it tells you.
<?php
$url = $_SERVER['REQUEST_URI'];
$setMainRoot = str_replace("test.php", "", $url);
$setDocumentRoot = str_replace("test.php", "", $_SERVER['SCRIPT_FILENAME']);
echo "\$MAIN_ROOT = \"".$setMainRoot."\";<br />";
echo "\$BASE_DIRECTORY = \"".$setDocumentRoot."\";";