Skip to main content
Topic: Installation in Subdirectory (Read 2982 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Installation in Subdirectory

Is it even possible to install ElkArte in a subdirectory? All of the assets, the CSS and Javascript and Image files, have bad URLs. I tried running the repair_settings script, but that didn't help.

Code: [Select]
	<link rel="stylesheet" href="/css/index.css" id="index.css" />
The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #1

It looks like it's missing a $themedir there, but why, is the most important part. What did you do *exactly*, please?
~ SimplePortal Support Team ~

Re: Installation in Subdirectory

Reply #2

Hi sottwell and welcome to elk.net. :)

Indeed, all the css, images and javascript should use a filly qualified URL, including domain and paths (see this very forum that is installed in a subdirectory of the domain).
I get you installed "fresh", so conversion problems can be excluded.
What version of php are you running?
Do you have any cache system installed?

May you try (for testing) to enable the minify of javascript and css you find in admin > config > features and options > general and then tick the option "Minify Javascript and CSS files".
Bugs creator.
Features destroyer.
Template killer.

Re: Installation in Subdirectory

Reply #3

Quote from: Flavio93Zena (#OpIsis) – It looks like it's missing a $themedir there, but why, is the most important part. What did you do *exactly*, please?
I simply installed it, then when it came up with the root URLs, ran the repair_settings.php script and selected all the recommended paths and URLs. No change.
The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #4

It doesn't even let me log in at all. I will wipe it out and try installing again.

I am well aware of the issues that can arise from compressing the css and the js; I always disable those features whenever possible.

Perhaps I should say that I'm a web developer, with 10 years experience working with the MODX CMS, as well as the Vanilla and the SMF forums.

I'll try installing it on another dev site in the root and see what happens.
The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #5

Ok. I installed it on a new dev server, nothing unusual except setting the database server to be 127.0.0.1

Now I'm getting URLs for assets like
Code: [Select]
http://127.0.0.1/elkarte/themes/default/css/index.css

But at least it lets me log in.

The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #6

Ok, I tried it on localhost and it works fine, so it must be something about the hosting. It was nginx servers, with built-in rewrite rules that probably conflict. Just to be clear, I was attempting to install it on the MODX Cloud hosting service, which I use for development sites.

Just to make things interesting, SMF, Vanilla, Grav, phpMyAdmin, even WordPress, install just fine alongside or instead of the default MODX installations.

PHP 5.6.15, MySQL 5.6.28-76.1

Working on finding out what the supplied nginx rewrite rules are.
Last Edit: February 11, 2016, 09:15:19 am by sottwell
The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #7

From what you are describing it looks like the "usual" issue (that should have been fixed a long while ago) regarding opcache in php 5.6.

Would you mind trying the following change?
In install.php, find:
Code: [Select]
	if (function_exists('opcache_invalidate'))
opcache_invalidate(dirname(__FILE__) . '/Settings.php');
and change it to:
Code: [Select]
	if (function_exists('opcache_invalidate'))
opcache_invalidate(dirname(__FILE__) . '/Settings.php', true);
Bugs creator.
Features destroyer.
Template killer.

Re: Installation in Subdirectory

Reply #8

Quote from: emanuele – From what you are describing it looks like the "usual" issue (that should have been fixed a long while ago) regarding opcache in php 5.6.

Would you mind trying the following change?
In install.php, find:
Code: [Select]
	if (function_exists('opcache_invalidate'))
opcache_invalidate(dirname(__FILE__) . '/Settings.php');
and change it to:
Code: [Select]
	if (function_exists('opcache_invalidate'))
opcache_invalidate(dirname(__FILE__) . '/Settings.php', true);

Will do.
The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #9

Nope. No go. Still using 127.0.0.1 as the domain for the assets URLs.

http://bb.sottwell.modxcloud.com/elkarte/index.php

I found some of them in the database and corrected them, but that doesn't solve where the base URL is defined.
Last Edit: February 11, 2016, 11:20:28 am by sottwell
The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #10

Are you taking that setting in the installation for the database server, and using that as the site base URL? If that is the case, that's not a very good idea. I work with a number of sites where the database is on a completely different server.
The Corner Case Queen - you make it, I'll break it

Re: Installation in Subdirectory

Reply #11

During the installation you are asked to provide the url of the forum. Elk installer tries to guess it based on the what it can find, but if the guess is wrong you can correct it.

The problem here, with the 127.0.0.1, looks like the opcache one (as I said before), but what sounds strange to me is the fact SMF installs without errors, because it doesn't even have the opcache invalidation and has suffered of this problem since a long time and it should fail 99% of the times (unless by chance the server has a temporary slowdown between the moment the file is written and the moment is included and in the meantime the opcache catches up and replaces the Settings.php file).

When you use repair_settings, are you able to set the correct url for the themes?
Bugs creator.
Features destroyer.
Template killer.