You need to log in before you can comment on or make changes to this bug.
When referring to your mapfile in index.phtml of a Chameleon application you must specify your path absolutely. If it is not specified with an absolute path then a specific portion of map_session.php does not get executed (as per below): lines 206 to 222 of map_session.php if ($szMapFilePath != "" && is_dir($szMapFilePath)) { if (strncasecmp( "lmx.", strrev($szMapFile), 4 ) == 0) { $this->oMap = ms_newMapObj( "" ); $this->oMap->loadMapContext( $szMapFile ); } else { $this->oMap = ms_newMapObj($szMapFile, $szMapFilePath); } } else { // set the map object to be the phpmapscript map object $this->oMap = ms_newMapObj($szMapFile); } map_ession should call the line that has ms_newMapObj($szMapFile, $szMapFilePath); but it calls the last line in the if, the one with ms_newMapObj($szMapFile);. Missing the original mapfile path is what causes MapServer to output an error. What needs to be figured out is why the wrong part of the if() is executed. Note that using an absolute path DOES work.
I debugged that stuff with Jason. What happens is that if you pass a relative path to a mapfile when you initialize your chameleon app (e.g. ../map/blah.map), then you end up with $szMapFilePath equal to "../map", and the test on is_dir($szMapFilePath) may fail. Even if it didn't fail, you may still have problems in the call to ms_newMapObj($szMapFile, $szMapFilePath) if you pass it a relative path. The solution: have chameleon turn the mapfile path into an absolute path when you load the mapfile initially, and use the absolute path to set $szMapFilePath
we will need some code in chameleon.php to figure out if the map file path is relative or absolute, and if it is relative, then calculate an absolute path from gszAppPath.
I think it would be helpful to have functions available to any php code that you can throw any kind of path or url at and get an absolute path or url back. Otherwise, we're going to end up with several implementations of this scattered throughout our widgets. I just added one to SECTPopup.widget.php last night.
There's realpaht() for filenames in PHP. It wouldn't work for URLs though, but I don't think we need that here anyway.
I copied a functoin from PHP doc site to resolve a relative path from an other path. I added the code to resolve the absolute path of the map using the gszAppPath var.
verfied with beta 2 2004-06-20 local copy of the hawaii demo and changes path to mapfile to a reletive path.
closing bug and changing target to "1.99 beta 2" since it has be verified with the beta 2.