Page 1 of 1

trouble with paths in 1.2.0

Posted: 21 Apr 2010, 03:57
by wiltech
My mantis site can be found at http://mantis.wilhelm-tech.com/

it seems to be running really really slow :(

and the links are appending the file system path into the virtual path
like: http://mantis.wilhelm-tech.com/mantisbt ... n_page.php
instead of: http://mantis.wilhelm-tech.com/main_page.php

I have this in my config_inc.php:

Code: Select all

	$g_path = 'http://mantis.wilhelm-tech.com/';
The php version is 5.2.5

let me know what else you need.

thanks
Tony W

Re: trouble with paths in 1.2.0

Posted: 21 Apr 2010, 07:12
by atrol
I recommend the following steps:

1. Update your PHP to the latest stable version of 5.2 (ATM 5.2.13)
2. Install the latest nightly build of MantisBT 1.2 (or wait until 1.2.1 is official available)
3. remove "$g_path = 'http://mantis.wilhelm-tech.com/';" from you config_inc.php

Re: trouble with paths in 1.2.0

Posted: 21 Apr 2010, 15:01
by wiltech
atrol wrote:I recommend the following steps:

1. Update your PHP to the latest stable version of 5.2 (ATM 5.2.13)
2. Install the latest nightly build of MantisBT 1.2 (or wait until 1.2.1 is official available)
3. remove "$g_path = 'http://mantis.wilhelm-tech.com/';" from you config_inc.php
1. This is installed on a shared hosting service (webhost4life) so i'm not sure i can update the version of PHP
2. OK, this will take a while to do over my 3G connection (sorry AT&T)
3. Done

now with only #3 done the url is rewritten from http://mantis.wilhelm-tech.com to http://mantis.wilhelm-tech.com/mantisbt ... n_page.php

not sure if it matters, but in the httpd.ini is this entry:

Code: Select all

RewriteCond Host: (?:.+\.)?mantis\.wilhelm-tech\.com
RewriteCond URL ^/mantisbt-1.2.0/(.*)
RewriteCond METHOD GET
RewriteRule ^/mantisbt-1.2.0/(.*) /$1 [I,L]
RewriteCond Host: (?:.+\.)?mantis\.wilhelm-tech\.com
RewriteCond METHOD POST
RewriteRule ^/mantisbt-1.2.0/(.*) /$1 [I]
RewriteCond Host: (?:.+\.)?mantis\.wilhelm-tech\.com
RewriteRule (.*) /mantisbt-1.2.0/$1 [I,L]
Now this was working when i upgraded from 1.1.8 to 1.2.0 back in March, but has since stopped working. And of course the ISP is incorrectly blaming the script...

thanks
Tony

Re: trouble with paths in 1.2.0

Posted: 21 Apr 2010, 21:15
by atrol
I should have written that you probably will not have a solution by following just one of the three steps.
At least AFAIK #2 and #3 will just work by following both

Re: trouble with paths in 1.2.0

Posted: 22 Apr 2010, 10:36
by Ferdy
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.

Code: Select all

$g_path = 'http://mantis/';
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

Re: trouble with paths in 1.2.0

Posted: 22 Apr 2010, 13:22
by atrol
Ferdy
would be great if you could check whether your problem has gone when using the latest nightly build (or wait for 1.2.1 which should be available the next few days)
I think this one is related to your problem
http://www.mantisbt.org/bugs/view.php?id=11534
and this is the fix for 1.2.1
http://git.mantisbt.org/?p=mantisbt.git ... dec1048aa6