1074

Why is it not loading properly?

Comments for “Why is it not loading properly?”
 

Posted by Kye on Thursday 16th May 2024 at 09:39 GMT

Hi there,

I have downloaded the framework and added it to the htdocs folder and renamed the base URL in the config.php file according to the instructions on the Youtube video. But when loading the URL in my browser, I do not see the same screen as in the Youtube video. Instead I just see the following in plain text:

"//The main config file define('BASE_URL', 'http://localhost/my_app'); define('ENV', 'dev'); define('DEFAULT_MODULE', 'welcome'); define('DEFAULT_CONTROLLER', 'Welcome'); define('DEFAULT_METHOD', 'index'); define('MODULE_ASSETS_TRIGGER', '_module'); define('INTERCEPT_404', 'trongate_pages/attempt_display');
Fatal error: Uncaught Error: Undefined constant "BASE_URL" in C:\xampp\htdocs\my_app\engine\ignition.php:24 Stack trace: #0 C:\xampp\htdocs\my_app\engine\ignition.php(97): get_segments() #1 C:\xampp\htdocs\my_app\public\index.php(2): require_once('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\my_app\engine\ignition.php on line 24"

Is there something else I need to do? Perhaps there is a configuration error?
Level One Member

Kye

User Level: Level One Member

Date Joined: 16/05/2024

Posted by DaFa on Thursday 16th May 2024 at 11:04 GMT

Hello Kye,

Can you try this again, assuming you are not using the Desktop App to install Trongate:
Open a command prompt or the Windows terminal and 'cd' to 'c:\xampp\htdocs' and run this command if you have git installed
git clone https://github.com/trongate/trongate-framework.git my_app
if not download the Trongate framework as a zip file from GitHub and extract it to a 'my_app' folder in 'htdocs'. Ensure the Xampp control panel is running Apache and MariaDB (both are green). Open the 'my_app' in your favourite editor and edit 'config.php' in the config folder of your app. Change the 'BASE_URL' to read as follows - NOTE the trialling '/' slash at the end:
//The main config file
define('BASE_URL', 'http://localhost/my_app/');
define('ENV', 'dev');
define('DEFAULT_MODULE', 'welcome');
define('DEFAULT_CONTROLLER', 'Welcome');
define('DEFAULT_METHOD', 'index');
define('MODULE_ASSETS_TRIGGER', '_module');
define('INTERCEPT_404', 'trongate_pages/attempt_display');
Then run 'phpMyAdmin' and create a new database called 'my_app'. Open 'database.php' in the config folder and edit it to read this (assuming you are using 'root' as your user and it has no password set)
//Database settings
define('HOST', '127.0.0.1');
define('PORT', '3306');
define('USER', 'root');
define('PASSWORD', '');
define('DATABASE', 'my_app');
Then open a browser and type this in the URL
http://localhost/my_app
If you have followed the instructions above all should be working and should be seeing the database import wizard. Once complete (with no errors) you will be presented with the welcome page. Alternatively, download and install the Desktop App and create a new Trongate app via it - it is SO much more simple than doing the above.

This comment was edited by DaFa on Thursday 16th May 2024 at 11:09 GMT

Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by Dom on Thursday 16th May 2024 at 11:06 GMT

Have you tried using the Trongate Desktop App for this? It takes care of a lot of the basic configuration for you. The advatage of using that to start off with is that it will give you a feel for the bits of app specific configuration that you would need to do if you just downloaded the framework from the Github repository.

I have just this minute tried creating a new app (via the Desktop app) which will have pulled down the latest Trongate version) and it works as expected.

Give the desktop app a go first and pay particular attention to the config files (found in the config directory) once you've done that.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

×