Closed jcubic closed 5 years ago
The code for calculating http_directory don't work on Linux (Fedora)
I've created simple file:
<?php $root_directory = dirname (dirname (__DIR__)); // Get HTTP root directory echo $_SERVER['DOCUMENT_ROOT'] . "\n"; $root_position = mb_strlen (realpath ($_SERVER['DOCUMENT_ROOT'])); $http_directory = mb_substr ($root_directory, $root_position); header('Content-Type: text/plain'); print_r(array( "root_directory" => $root_directory, "root_position" => $root_position, "http_directory" => $http_directory )); ?>
and the output look like this:
/var/www/html Array ( [root_directory] => /mnt/ssd/projects/jcubic/www [root_position] => 13 [http_directory] => ects/jcubic/www )
in my case I have symlink /var/www/html/projects -> /mnt/ssd/projects
/var/www/html/projects -> /mnt/ssd/projects
I've fixed the issue by adding:
$http_directory = preg_replace("%/[^/]+/[^/]+$%", "", $_SERVER['REQUEST_URI']);
in settings.php
The code for calculating http_directory don't work on Linux (Fedora)
I've created simple file:
and the output look like this:
in my case I have symlink
/var/www/html/projects -> /mnt/ssd/projects
I've fixed the issue by adding:
in settings.php