Tested on PHP 7.2.3
You need a unix based server.
Install Joomla in the root path: /
Absolute paths:
/index.php
/administrator/
etc...
Ps.: I know it is strange, but I think there are special context when this can happen.
JPATH contants should contain a path without the ending directory separator
JPATH constants contains the directory separator
In this environment __DIR__
constant holds /
in the root folder. Normally the __DIR__
constant holds the path without the ending directory separator like /public_html
includes/defines.php
// Global definitions
$parts = explode(DIRECTORY_SEPARATOR, JPATH_BASE);
// Defines.
define('JPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts));
define('JPATH_SITE', JPATH_ROOT);
define('JPATH_CONFIGURATION', JPATH_ROOT);
So all of this constants will be /
instead of empty string.
Probably __DIR__
holds the not expected value which should be fixed in index.php
define('JPATH_BASE', __DIR__ === DIRECTORY_SEPARATOR ? '' : __DIR__);
__DIR__
bug in PHP itself?I do not think so, PHP describes __DIR__
constant with the following:
The directory of the file. If used inside an include, the directory of the included file is returned. This is equivalent to dirname(FILE). This directory name does not have a trailing slash unless it is the root directory.
Labels |
Added:
?
|
I think that server had some kind of special chroot jail environment, where every virtualhost on the shared server has their own simulated empty root folder where the owner can put the PHP files.
This bug report based on a support of my extension and I do not have access to it anymore. Also the user probably just an end user who paid for the shared hosting, so probably he does not have any more info about the technological details. I'm not sure if it helps, but the site was hosted at https://home.pl
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-23 16:01:10 |
Closed_By | ⇒ | Quy |
Closed_By | Quy | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23148
Closing per PR #23149.
@nextend It is not necessary to open an issue if you have a pull request for the issue. Just create the PR along with the issue information. Thanks.
I would say this is a VERY fringe case right? I cannot think of a situation when someone would ever want to do that ?