So I know there are other threads. But none of them seem to be working for me.
I'm trying to install Flarum on Hostingers cloud service. I'm using Composer2 and installing it under a ./forum folder. But I want to serve it from the root (or public_html in Hostinger's case). I've added a index.php that looks like this (removed the comments to make it shorter):
<?php
$site = require './forum/site.php';
$server = new Flarum\Http\Server($site);
$server->listen();
use Elasticsearch\ClientBuilder;
require 'vendor/autoload.php';
$client = ClientBuilder::create()->build();
The site.php file (without the comments):
<?php
require __DIR__.'/vendor/autoload.php';
return Flarum\Foundation\Site::fromPaths([
'base' => __DIR__,
'public' => __DIR__.'/public',
'storage' => __DIR__.'/storage',
]);
The config.php file:
<?php return array (
'debug' => false,
'database' =>
array (
'driver' => 'mysql',
'host' => 'localhost',
'port' => 3306,
'database' => 'xxx',
'username' => 'xxx',
'password' => 'xxx',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => 'xxx',
'strict' => false,
'engine' => 'InnoDB',
'prefix_indexes' => true,
),
'url' => 'https://mydomain.com',
'paths' =>
array (
'api' => 'api',
'admin' => 'admin',
),
'headers' =>
array (
'poweredByHeader' => true,
'referrerPolicy' => 'same-origin',
),
);
I get this page with the current configuration:
"Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error."
Any ideas? I would highly appreciate help with this to set it up correctly.