Thank you!  I’ve tried, it works quite well.



But according to my book, to force Apache to load the CGI version of

PHP, user must add the following lines in the Apache config file httpd.conf:



AddHandler php-script .php

Action php-script /cgi-bin/php



Then delete the reference to .php from the AddType line (if it exists), so it 
looks like this:

AddType application/x-httpd-php .html .phtml



“

By removing .php from the AddType directive, files with this extension will use 
the CGI version

of PHP even if the environment contains a DSO version. If you don’t remove the 
reference,

then Apache will continue to use the DSO version of PHP to handle documents of 
type php. “



-- from book <Apress Beginning MapServer Open Source GIS Development>





My Questions are:



1.       Does the procedures described above are required for MS4W? (The book 
author

did the illustration on the Linux version of mapserver, I guess so).



2.       That loading the PHP Mapscript module in my PHP script dynamically 
does work,

but does that mean my server has to load this module repeatedly for every web 
client

request? Is there a better solution that apache will load PHP Mapscipt module 
automatically

whenever starting?





Jeff Zhao,

Chengdu, China

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff McKenna
Sent: 2008年6月23日 21:31
To: Mapserver-users
Subject: Re: [mapserver-users] php fails on MS4W and Apache



You must dynamically load the PHPMapscript module in your PHP script, with 
MS4W.  See the example script in /ms4w/Apache/htdocs/quickmap.php



-jeff





---

Jeff McKenna

FOSS4G Consulting and Training Services

http://www.gatewaygeomatics.com/









On 23-Jun-08, at 5:11 AM, Zhao Ying (CDU) wrote:





Greetings,



I’m trying to test my PHP MapScript environment on MS4W.

Unfortunately, each time I run the following php file on the apache server 
within MS4W, a same

error message is always thrown:



-- Error Message:

Fatal error: Call to undefined function ms_newMapObj() in 
C:\ms4w\Apache\htdocs\phpms_hello.php on line 7



-- PHP file:  phpms_hello.php

This example is from chapter8, book <Apress Beginning MapServer Open Source GIS 
Development Aug 2005>

however, according to the author, this example is expected to be run a Linux 
version mapserver (I guess so),

so I’m under the assumption that all configuration procedures described in this 
book before running this example

won’t work for MS4W.



<?php



  // Create a unique image name every time through

  $image_name = sprintf("phpms-hello%0.6d",rand(0,999999)).".png";



  // Create a new instance of a map object

  $map = ms_newMapObj("/ms4w/test2/hello.map");



  // Create an image of the map and save it to disk

  $image=$map->draw();

  $image->saveImage("/ms4w/tmp/ms_tmp/".$image_name);

?>



<html>

<head><title>PHP MapScript Hello World</title></head>

<body>

  <form action="phpms_hello.php" method="POST">

    <input type="image" name="img"

          src="/tmp/<?php echo $image_name; ?>">

  </form>

</body>

</html>





Did I miss some configurations for MS4W to work with php or something?

Thanks!!!



Jeff.

Chengdu, China










Legal Disclaimer:
The information contained in this message may be privileged and confidential. 
It is intended to be read only by the individual or entity to whom it is 
addressed or by their designee. If the reader of this message is not the 
intended recipient, you are on notice that any distribution of this message, in 
any form, is strictly prohibited. If you have received this message in error, 
please immediately notify the sender and delete or destroy any copy of this 
message
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to