Was having a similar problem.
I've installed mantis v1.2.0 in
/var/www/html/mantisbt-1.2.0
I've created a symlink
/var/www/html/mantisbt which points to this path
I've created a VirtualHost in Apache with it's document root pointing to this symlink
When I open Mantis in my browser the index is displayed but all external resources are linked wrong. For example the link to
My View is
http://mantis/-1.2.0/my_view_page.php where I would expect
http://mantis/my_view_page.php.
Adding the following line to my config_inc.php did not make a difference.
The source for this problem is config_defaults_inc.php:133, where the
virtual document-root is mixed up with a
physical filepath, leaving the core to think Mantis is running from a subfolder called "-1.2.0".
Code: Select all
$t_docroot string(22) "/var/www/html/mantisbt"
$t_file_path string(52) "/var/www/html/mantisbt-1.2.0/config_defaults_inc.php"
$t_path string(6) "-1.2.0"
This issue can be resolved by either using only virtual or physical paths to compare. In this case, by not using the $
_SERVER['DOCUMENT_ROOT'] but the physical location of the config file;
Code: Select all
--- config_defaults_inc.php
+++ config_defaults_inc.php
@@ -125,7 +125,7 @@
}
}
- $t_docroot = rtrim( $_SERVER['DOCUMENT_ROOT'], '/' );
+ $t_docroot = dirname(__FILE__);
$t_file_path = str_replace( DIRECTORY_SEPARATOR, '/', __FILE__ );
// Extract the unique directory path of this file relative to the server's documunt root