On the public_html/index.php file, try replacing
define('CRAFT_BASE_PATH', dirname(__DIR__));
with
define('CRAFT_BASE_PATH', ('/home/pathToCraftFolder/craft'));
The structure of my folders areis as follow:
/home/username/
- public_html, or just html / this is where the content of your web folder goes
- config
- modules
- storage
- templates
- vendor
- (and then the composer/env files)
Then on the index.php file (which can be found under /home/username/public_html/index.php),you'd replace:
define('CRAFT_BASE_PATH', dirname(__DIR__));
with
define('CRAFT_BASE_PATH', ('/home/pathToCraftFolder/'));
If you only have access to the public_html folder or would like to install craft3 on a subfolder this is how you can structure it:
on your public_html (/home/username/public_html), create a craft subfolder((/home/username/public_html/craft)), then send your craft3 web folder into the public_html. It should look like this:
/home/username/public_html/
-index.php
-web.config
-.htaccess
/craft/
In your index.php file, replace
define('CRAFT_BASE_PATH', dirname(__DIR__));
with
define('CRAFT_BASE_PATH', ('/home/pathToCraftFolder/craft'));
Hope this helps.