undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

giorgos
Hi all,

I am really new into Mapscript and PHP and I have a question about continuous undefined function messages that I am getting. It may be something wrong with my configuration but I can not find what that may be.
I am getting Fatal error messages for functions such as: "ms_newPointObj()" and "ms_newMapObj()".

I looked the archive for some similar messages in the past and a reply was to load the mapscript by looking the example in /ms4w/Apache/htdocs/quickmap.php

I run that example and I am getting an undefined function for the dl().
I looked the php.ini file and I have active the "extension=php_mapscript.dll". I think my extension directory has been set up fine in the php.ini and I have run out of options.

Any help will be much appreciated.

George
Reply | Threaded
Open this post in threaded view
|

Re: undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

jmckenna
Administrator
Hello George,

To test this, on a fresh Windows machine (a machine that you've never
installed PHP or MS4W/MapServer on before) do the following:

- install MS4W
        - installer: http://www.maptools.org/dl/ms4w/ms4w-3.0.2-setup.exe
        - or archive: http://www.maptools.org/dl/ms4w/ms4w_3.0.2.zip

- if using archive, make sure to install Apache
        - open command prompt
        - cd to ms4w
        - execute: setenv.bat
        - execute: apache-install.bat

- open in a text editor: /ms4w/Apache/htdocs/quickmap.php

- edit line#14 (path to mapfile)

- save the file

- in your web browser, goto http://127.0.0.1/quickmap.php

- a map image should be displayed, or an error

What is your result?

(note: some users report problems with older Windows versions, such as
XP; Vista or Windows7 is recommended for this testing)

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 11-06-28 4:50 AM, giorgos wrote:

> Hi all,
>
> I am really new into Mapscript and PHP and I have a question about
> continuous undefined function messages that I am getting. It may be
> something wrong with my configuration but I can not find what that may be.
> I am getting Fatal error messages for functions such as: "ms_newPointObj()"
> and "ms_newMapObj()".
>
> I looked the archive for some similar messages in the past and a reply was
> to load the mapscript by looking the example in
> /ms4w/Apache/htdocs/quickmap.php
>
> I run that example and I am getting an undefined function for the dl().
> I looked the php.ini file and I have active the
> "extension=php_mapscript.dll". I think my extension directory has been set
> up fine in the php.ini and I have run out of options.
>
> Any help will be much appreciated.
>
> George
>



_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users
Reply | Threaded
Open this post in threaded view
|

Re: undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

giorgos
Thanks Jeff,

I have done all these and when I load quickmap.php I get the following:
"Fatal error: Call to undefined function dl() in C:\ms4w\Apache\htdocs\quickmap.php on line 18"

If I comment line 18 and by assuming that I do not need dl(), I get another error:
Fatal error: Call to undefined function ms_newMapObj() in C:\ms4w\Apache\htdocs\quickmap.php on line 21

The only difference between your instructions and what I do here is that I run the whole thing under port 8080, i.e.: http://127.0.0.1:8080/quickmap.php
I do not think the port is important anyway. I can see maps with html templates but I can not do anything with php.

I am using windows Vista.

Thanks again,
George

Reply | Threaded
Open this post in threaded view
|

Re: undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

jmckenna
Administrator
Hello George,

On a fresh machine (a Windows machine that you have never installed PHP or MS4W/MapServer on) can you execute my steps exactly?

Thanks.

Note: if you are really stuck you can always contact me directly for professional support, and we can discuss support rates....there is always help available :)

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/ 


Reply | Threaded
Open this post in threaded view
|

Re: undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

giorgos
Thanks very much Jeff.

You were right. I did not have a fresh machine over here but I cleaned up the existing one, I re-installed everything and it works now.
The problem was probably caused because I installed OSGeo4W before ms4w and I had a separate installation of PHP. Too many installations caused the problem.
However, there is plenty of room for improving the way users find out about this since the warning and the error messages in such cases had nothing to do with the whole problem. Perhaps, the ms4w installer should in the future check if exiting other installations (of PHP, Apache, etc.) exist and warn the user.

Many thanks again,
George
Reply | Threaded
Open this post in threaded view
|

Re: undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

batgioi
In reply to this post by jmckenna
Dear you,

I performed the same your guideline and tested Apache, php, Map Server successfully.

But when I run php file with following code:
<?php
  dl("php_mapscript.dll");
?>
I got error: “Fatal error: Call to undefined function dl() in C:\ms4w\Apache\htdocs\phpinfo.php on line 2”

I search Google and see that it is error which php5 deprecats dl() functions. But I do not know it is true or false? And now I do not how to fix?

Please help me,
Thank you so much!
Reply | Threaded
Open this post in threaded view
|

Re: undefined functions: ms_newPointObj() , ms_newMapObj(), dl() , etc.

pvillegasy
In reply to this post by jmckenna
Hola Jeff, llevo un fin de semana trantaod de hacer algo con mapserver, pero no he podido. He probado tus instruccion y no funciona, me sale el siguiente error:  
Warning: ms_newMapObj(): [MapServer Error]: msLoadMap(): (C:/ms4w/apps/gmap/htdocs/MFD/ejemplo1.map) in C:\ms4w\Apache\htdocs\Pedro\pedro.php on line 21 Fatal error: Uncaught exception 'MapScriptException' with message 'Failed to open map file "C:/ms4w/apps/gmap/htdocs/MFD/ejemplo1.map"' in C:\ms4w\Apache\htdocs\Pedro\pedro.php:21 Stack trace: #0 C:\ms4w\Apache\htdocs\Pedro\pedro.php(21): ms_newMapObj('C:/ms4w/apps/gm...') #1 {main} thrown in C:\ms4w\Apache\htdocs\Pedro\pedro.php on line 21

La linea 21 corresponde a $oMap = ms_newMapObj( MAPFILE );
que es el error que siempre me sale con todos los programas que he probado, que puedo hacer...por favor estoy estancado.
Estoy trabajando con windows Vista... yo había instalad Apache, peor antes de instalar ms4w lo desinstalé

Te agradezco mucho tu ayuda