#42 - $_SERVER['PATH_INFO'] issue, traq not working
Type Defect
Status Invalid
Milestone 0.6
Version -
Component Core
Priority Highest
Severity Blocker
Owner fabianCastle
Assigned to -
Reported 15 years ago
Updated 10 years ago
Votes 0
Related tickets
Proposed time
Worked time

After testing the application this afternoon (an liking it), I decided to upload it to my web server. Unfortunally, it stopped working.

Seems like the $_SERVER['PATH_INFO'] (in the uri class) is not returning anything, therefore anything further the projectlisting is not accessible any more.

Please review and let me know, thanks.

Ticket History

15 years ago by fabianCastle

  • Priority Normal Highest

15 years ago by fabianCastle

  • Component Tickets Core
  • Status New Reopened

I have fixed it in my hosting-server, by I had to modify the URI calls as indicated bellow:

<?php /**

  • Origin
  • Copyright (c) 2009 Rainbird Studios
  • $Id: uri.php 21 2009-02-22 06:59:44Z jack $ */

/**

  • URI Class
  • @version $Rev: 21 $ */ class URI { public $seg = array();

    public function __construct() { / Modified by Fabian / $installationDir="traq/"; $pathinfo = trim($_SERVER['REQUEST_URI'],'/'); $pathinfo = trim(str_replace($installationDir,"",$pathinfo)); if($installationDir==$pathinfo."/") $pathinfo=""; /////////////////////////////////////////////////////////////////

    $segments = explode('/',$pathinfo);
    $this->seg = $segments;

    }

    public function geturi() { return $this->anchor().implode('/',$this->seg).'/'; }

    public function anchor($segments = array()) {

    if(!is_array($segments)) {
        $segments = func_get_args();
    }
    /* Modified by Fabian */
        $installationDir= "http://". $_SERVER["HTTP_HOST"]. "/traq/";
        $path = str_replace('index.php','',$_SERVER['SCRIPT_NAME']);
        return  $installationDir . $this->array_to_uri($segments);
    ////////////////////////////////////////////////////////////////////

    }

    private function array_to_uri($segments = array()) { if(count($segments) < 1 or !is_array($segments)) { return; } foreach($segments as $key => $val) { $segs[] = $val; } return implode('/',$segs).'/'; }

} ?>

Would you please analyze these changes, it might not be the best way to solve it,but it worked for me. Hope that this helps you.

15 years ago by Jack

What web server are you running? Apache/Lighttpd/nginx/IIS ?

15 years ago by Jack

  • Status Reopened New

15 years ago by fabianCastle

Linux, Centos, Apache Another fact is that I had already a main application running in public folder and in order to install traq 0.5 I had to create another folder for it's dedicated use. In other workds, traq 0.5 was not installed directly on the virtualhost directory, but in a sub-folder.

Jack closed as Invalid 15 years ago

Traq is designed to be accessed directly, not through a sub folder.