Environment::getBasePath() issue
Posted: Fri Aug 23, 2019 12:48 am
I'm trying to run timetrex in a jailed apache instance, under /www.
Apache is installed under /www along with PHP and the other needed bits.
Timetrex is installed in /www/data/ttrex0.my.domain/ .
To make administration and management easier, under /www there is a symlink from 'www' to '.'. This lets us use /www/whatever to reach things, regardless of whether or not we are in the jail.
The setup check is failing:
PHP CLI requirements failed while executing
"/www/bin/php" "/data/ttrex0.my.domain/tools/unattended_upgrade.php" --config "/data/ttrex0.my.domain/includes/../timetrex.ini.php" --requirements_only --web_installer
Likely caused by having two PHP.INI files with different settings.
and the problem is that the files are in /www/data, not /data.
If I enter the jail and manually run:
/www/bin/php /www/data/ttrex0.my.domain/tools/unattended_upgrade.php --config /data/ttrex0.my/domain/includes/../timetrex.ini.php --requirements_only
the check passes.
It looks like something that feeds Environmenet::getBasePath() sees that 'www' is a link to '.' and is deciding to strip it. But this doesn't work because the top of the jail has things like bin, etc, lib, …, and www. The 'data' subdir is only under /www/ . If the www is stripped, fully-rooted paths stop working.
I don't think I'm explaining this ideally, but I hope I'm at least explaining it well enough.
Since this box will be exposed to the internet, we really want it to be secure, and use a jailed apache instance just like all our other internet-visible apache machines.
Recommendations?
H
Apache is installed under /www along with PHP and the other needed bits.
Timetrex is installed in /www/data/ttrex0.my.domain/ .
To make administration and management easier, under /www there is a symlink from 'www' to '.'. This lets us use /www/whatever to reach things, regardless of whether or not we are in the jail.
The setup check is failing:
PHP CLI requirements failed while executing
"/www/bin/php" "/data/ttrex0.my.domain/tools/unattended_upgrade.php" --config "/data/ttrex0.my.domain/includes/../timetrex.ini.php" --requirements_only --web_installer
Likely caused by having two PHP.INI files with different settings.
and the problem is that the files are in /www/data, not /data.
If I enter the jail and manually run:
/www/bin/php /www/data/ttrex0.my.domain/tools/unattended_upgrade.php --config /data/ttrex0.my/domain/includes/../timetrex.ini.php --requirements_only
the check passes.
It looks like something that feeds Environmenet::getBasePath() sees that 'www' is a link to '.' and is deciding to strip it. But this doesn't work because the top of the jail has things like bin, etc, lib, …, and www. The 'data' subdir is only under /www/ . If the www is stripped, fully-rooted paths stop working.
I don't think I'm explaining this ideally, but I hope I'm at least explaining it well enough.
Since this box will be exposed to the internet, we really want it to be secure, and use a jailed apache instance just like all our other internet-visible apache machines.
Recommendations?
H