Im in the process of installing flarum beta 9 on shared hosting with a given user directory, in which I created a flarum directory:
/home/user
/home/user/flarum
/home/user/flarum/vendor
/home/user/flarum/storage
etc.
Them, I have a public folder called html:
/home/user/html
... which is a symlink to
/var/www/virtual/user/html
I moved the contents of /home/user/flarum/public
into the /var/www/virtual/user/html
directory and adapted the /var/www/virtual/user/html/index.php
and /home/user/flarum/flarum
files:
index.php
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/* require '/home/user/flarum/vendor/autoload.php'; */
require '/../../../../../home/user/flarum/vendor/autoload.php';
$server = new Flarum\Http\Server(
Flarum\Foundation\Site::fromPaths([
/* 'base' => '/home/user/flarum', */
'base' => __DIR__.'/../../../../../home/user/flarum',
/* 'public' => '/home/user/html', */
'public' => __DIR__,
/* 'storage' => '/home/user/flarum/storage', */
'storage' => __DIR__.'/../../../../../home/user/flarum/storage',
])
);
$server->listen();
flarum
#!/usr/bin/env php
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require 'vendor/autoload.php';
$server = new Flarum\Console\Server(
Flarum\Foundation\Site::fromPaths([
'base' => __DIR__,
/* 'public' => __DIR__.'/../html', */
'public' => __DIR__.'/../../../var/www/virtual/user/html',
'storage' => __DIR__.'/storage',
])
);
$server->listen();
As you can see, I tried absolute as well as relative paths and pointing to the symlink as well as to the html
directory directly.
Whatever I try, when Itry to access the start page I get an error in the console:
TypeError: flarum.core is undefined
And the code that leads to this error is in the generated html template:
<script>
document.getElementById('flarum-loading').style.display = 'none';
try {
=> flarum.core.app.load({"resources":...});
flarum.core.app.bootExtensions(flarum.extensions);
flarum.core.app.boot();
} catch (e) {
var error = document.getElementById('flarum-loading-error');
error.innerHTML += document.getElementById('flarum-content').textContent;
error.style.display = 'block';
throw e;
}
</script>
The assets are included just fine (favicon, css, js, fonts), but the js execution fails.
Trying to access the admin panel ends with the same error.
Has anyone an idea what I'm doing wrong?