[ka-Map-users] Newbie: Need help with IIS configuration???

Paul Spencer pspencer at dmsolutions.ca
Wed May 23 20:33:52 EDT 2007


Hi Todd,

comments inline below ...

On 23-May-07, at 5:52 PM, Todd Fagin wrote:

> Greetings Ka-Map users,
>
>
>
> I am an extreme newbie to the world of Ka-Map and am having  
> problems getting the application to work.  I have worked with  
> MapServer before, though, primarily writing and testing map files  
> that others eventually deploy.  I am pretty ignorant about all  
> things server related, so please bear with me as I try to explain  
> what I have done and the problems encountered.  I cannot guarantee  
> that I will always use the correct terminology to explain things.
>
>
>
> First things, first:  I am running IIS 5.1 and recently installed  
> the latest version of PHP for IIS.  I confirmed the installation  
> was successful via a simple “hello world” program using the PHP echo 
> () statement. Also, as previously alluded, I already had MS4W  
> installed and working.
>
>
>
> Second, since I am using IIS instead of Apache (which all of the  
> documentation I have been able to find seems to be related to  
> Apache), I decided to use my very limited knowledge of servers to  
> proceed.  I created a virtual directory called kamap under my  
> default website and pointed this to the appropriate directory (in  
> my case C:\ka-map-1.0\htdocs).
>
>
>
> Next, following steps in both the Ka-Map wiki and Tyler Mitchell  
> tutorial, I configured Ka-Map (version 1.0).  Originally, I tried  
> to use a map file that I had previously written. I have used this  
> map file in a MapServer application before, so I know there aren’t  
> any problems with it.  I nonetheless ran shp2img to confirm this.   
> Again, no problems with the map file.
>
>
>
> Nonetheless, once I made appropriate changes to the include/ 
> config.dist.php file and renamed it config.dist, I

you meant config.php, I'm sure :)

> could not get my Ka-Map application to work.  Perhaps I am going  
> about this incorrectly, but what I did was, using my browser  
> (Firefox 1.5.0.11 in case that information is of use to anyone), I  
> entered the following url: http://localhost/kamap/index.html.  And,  
> as you can guess, I did not get a map.
>
>
>
> So, I decided to follow Tyler Mitchell’s tutorial a little closer  
> and use the map file and data he uses: global.map. Again, using  
> shp2img I confirmed there were no problems with my map file.
>
>
>
> Still, no map.  I tried some additional tweaking, moving the map  
> file and data to different directories (and ensuring I updated all  
> relevant lines of code when I did so).  I put the map file in the / 
> include directory. I put it in htdocs directory.  I put it in its  
> own directory.  No matter what I did, no map.
>
>
>
> Finally (well, I actually did this as I went along, too), I  
> followed the various suggestions in the troubleshooting section of  
> the wiki.  The last item seems to be the biggest clue to date: “If  
> you are still having problems, you can try loading the init.php  
> file into your URL.”  And that I did: http://localhost/kamap/init.php:
>
>
>
> And here is what I get:
>
>
>
> Warning: dl() [function.dl]: Not supported in multithreaded Web  
> servers - use extension=php_mapscript_46.dll in your php.ini in C: 
> \ka-map-1.0\htdocs\init.php on line 118
>
> Fatal error: Call to undefined function ms_newMapObj() in C:\ka- 
> map-1.0\htdocs\init.php on line 124

Extensions to PHP can be compiled into the PHP executable (common on  
linux) or can be compiled as external libraries (dlls) and loaded  
dynamically.  There are two ways to dynamically load an extension,  
one is to add extension= in php.ini and the other is to use dl() in  
the code.  ka-Map's init.php should be checking to see if 'MapScript'  
is already loaded before it tries to use the dl() function.  This  
means that, despite your best intentions, your php.ini is either  
flawed or not being used for some reason.  To confirm this, you can:

1. extend your hello world to call some function only available in an  
extension that is not already part of PHP
2. run it to confirm that it fails
3. modify your php.ini to load the extension
4. re-run the test to see if it works.  If it does work, then there  
is something wrong with the mapscript extension.   If it doesn't work  
then there is something wrong with your IIS configuration.

Note that there can be several reasons why mapscript will fail to  
load - you might want to turn on logging of all errors to a file -  
including the inability of the dll to find related dependencies.   
MS4W is pre-built and configured to solve all of these dependency  
problems but if you want to (or must) work with IIS then you may have  
to add the path to the dependencies into your system environment PATH  
or something.

>
>
> Per the warning, the best I can tell, I AM using  
> extension=php_mapscript_46.dll:
>
>
>
> $szPHPMapScriptModule = 'php_mapscript_46.'.PHP_SHLIB_SUFFIX;
>
>
>
> As for the fatal error, I am stumped (line 124: $oMap = ms_newMapObj 
> ( $aszMapFile['path'] );

this just means that the mapscript module did not get loaded correctly.

Cheers (and good luck!)

Paul

>
>
> Any suggestions, tips, constructive berating, etc. would be greatly  
> appreciated.  Feel free to contact me off list, if you please.
>
>
>
> Thanks,
>
>
>
> Todd Fagin
>
>
>
> Coordinate Solutions, Inc.
>
> 501 N.E. 15th St.
>
> Oklahoma City, OK 73104
>
> 405.740.4324 (voice)
>
> 904.471.5548 (fax)
>
> www.coordinatesolutions.com
>
>
>
>
>
>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+








More information about the ka-Map-users mailing list