Re: [MapServer-users] CGI variable "map" fails to validate
Shouldn't it be ".*' ? On 06/03/2024 23:29, Lernout, Matthew via MapServer-users wrote: So, still banging my head against this a month later after eliminating HTTPS as the bogeyman. Using FastCGI and MapServer with the simplest config and what should be an "allow everything" test expression: CONFIG ENV MS_MAP_PATTERN "." END END And all requests return: msLoadMap(): Regular expression error. Filename validation failed. BONUS: If I strip out the map variable from my request, I'd expect the error "CGI variable "map" is not set." but I still get "msLoadMap(): Regular expression error. Filename validation failed." even without providing a map! This is following IISRESET, and I know the config is being loaded (if I remove it, I get "msLoadConfig(): Unable to access file") If I'm not supplying a map parameter in my request and it's not throwing an error that it's missing, what is being used for map value against the expression? (And how do I get it to read my variable in the request?) Thanks for any direction, Matt -Original Message- From: MapServer-users On Behalf Of Lernout, Matthew via MapServer-users Sent: Wednesday, February 7, 2024 3:32 PM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate Hi, After scratching my head for a while, realized all my testing was over HTTPS. Made a localhost connection over HTTP and the map variable was then valid. I was looking in the wrong place - the error reports a failed validation, but that's due to failed certificate trust from what I can see. Thanks for helping me steer into the real issue - I now have a direction to move in! Matt -Original Message- From: Rahkonen Jukka Sent: Wednesday, February 7, 2024 1:05 PM To: Lernout, Matthew ; mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi, "." works for me. I have a Windows env set first as set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf These are the meaningful lines in the "ms4w.conf" file. CONFIG ENV MS_MAP_PATTERN "." END END Test proves that validation is successful http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map) -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: MapServer-users Puolesta Lernout, Matthew via MapServer-users Lähetetty: keskiviikko 7. helmikuuta 2024 19.01 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: Re: [MapServer-users] CGI variable "map" fails to validate I've ensured I am restarting the mapserv process with each config change - a quick test of commenting out the MS_MAP_PATTERN variable confirmed that is enough to refresh the config via error. Here's a snippet of a sample request. It works with my running instance of Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1. /cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map Matt -Original Message- From: Seth G Sent: Wednesday, February 7, 2024 11:48 AM To: Lernout, Matthew ; MapServer Users Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from se...@geographika.co.uk. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi Matthew, The CONFIG file I think is only reloaded when IIS or the Application Pool is restarted, so some changes to the regex may have been ignored. Do you have a sample request with the = parameter? Is there anything in a web.config file that could be stripping these out or modifying them? Seth -- web:https://geographika.net/ & https://mapserverstudio.net/ twitter: @geographika On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote: MS_MAP_PATTERN '.' also results in the same failed validation error, which is what makes me think the issue may be with another config setting. '.' should match any input, right? Just to make sure my config file was being loaded, I commented out the MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web application error. Required configuration value MS_MAP_PATTERN not set." Matt -Original Message- From: MapServer-users On Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users Sent: Wednesday, February 7, 2024 3:24 AM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from mapserver-users@lists.osgeo.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi, I'm not sure whether the pattern is correct. Shouldn't ist start with ^? Have yout tried MS_MAP_PATTERN '.'? (not for production, just as a test) Jörg Am 06.02.24 um 20:12 schrieb Lernout, Matthew via
Re: [MapServer-users] multiple shapepaths
No, this is too complex. And Steve's runtime-substutions with %path% in de URL probably does not work. I don't see how that could be done in PHP-MapScript. On 06/12/2023 21:23, Rahkonen Jukka wrote: Hi, Or write the DATA with full-path into an INCLUDE file if there are loads of mapfiles using the same paths. Then there would be much less editing when the paths change. -Jukka Rahkonen- *Lähettäjä:* MapServer-users *Puolesta *Lime, Steve D (MNIT) via MapServer-users *Lähetetty:* keskiviikko 6. joulukuuta 2023 21.59 *Vastaanottaja:* j.l.h.hartm...@gmail.com; Steve Lime *Kopio:* mapserver-users@lists.osgeo.org *Aihe:* Re: [MapServer-users] multiple shapepaths IMHO, if you do a SHAPEPATH at the layer level then you might as well just add the full-path to the DATA element. You’re not really gaining anything with the additional complexity. Did the idea of using runtime variables not pan out? *From:*MapServer-users *On Behalf Of *Jan Hartmann via MapServer-users *Sent:* Wednesday, December 6, 2023 1:14 AM *To:* Steve Lime *Cc:* mapserver-users@lists.osgeo.org *Subject:* Re: [MapServer-users] multiple shapepaths How about a shapepath at the layer level? I am combining 20 years of working with old maps in three (or four :-)) different countries (Netherlands, Germany and Flemish and Walloon Belgium), all in their own formats, projections, directories an servers. It would help to keep my applications (and my mind) clear if I could use the appropriate shapepaths. And as to portability, it is essential to use relative paths. Just try to move a website to a new server with a differently named filesystem, if all paths are hard coded. Jan Op 5 dec 2023 om 15:43 heeft Steve Lime het volgende geschreven: It won’t work. A configuration is loaded in entirety first, and then applied as necessary. On Tue, Dec 5, 2023 at 7:21 AM Jan Hartmann via MapServer-users wrote: Not sure. I cannot get it working anyway. Any ideas, Steve? On 04/12/2023 10:10, Jörg Thomsen (WhereGroup) via MapServer-users wrote: > Hi, > > I am not sure, but perhaps overwriting it, would work? > > MAP > > shapepath 'blah' > > Layer 1 > Layer 2 > > shapepath 'blubb' > > Layer 3 > Layer 4 > > Jörg > > > > Am 02.12.23 um 19:32 schrieb Jan Hartmann via MapServer-users: >> Yes, that is what I sought, didn't know it was possible. Thanks! >> >> Jan >> >> On 02/12/2023 19:29, Steve Lime wrote: >>> One other thought, you can use multiple paths via runtime subs to >>> approximate what I think you’re looking for, so: >>> >>> WEB >>> VALIDATION >>> path1_default “/opt/path1” >>> path1 “^\/opt\/path1$” >>> path2_default “/opt/path2” >>> path2 “^\/opt\/path2$” >>> END >>> END >>> >>> Then in DATA values you’d use %path1% or %path2%. This is another >>> use case for variables that was suggested recently. We could, >>> perhaps, define a way to mark something as immutable via url so the >>> regex could be simplified and only the default would ever be used >>> (e.g. “path2” “immutable”). >>> >>> —Steve >>> >>> On Fri, Dec 1, 2023 at 11:28 PM Steve Lime wrote: >>> >>> Nope, just the one value. >>> >>> On Fri, Dec 1, 2023 at 1:02 PM Jan Hartmann via MapServer-users >>> wrote: >>> >>> Hi, >>> >>> Is it possible to use multiple paths in a shapepath? >>> ./data1:./data2 >>> does not work >>> >>> Jan >>> ___ >>> MapServer-users mailing list >>> MapServer-users@lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> >> >> ___ >> MapServer-users mailing list >> MapServer-users@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] multiple shapepaths
Yes, setting a runtime variable is equivalent to an adaptable shapepath. I hadn’t realised that they could be set in thr MapFile. Can they be set in PHP Mapscript as:$oMap->web->validation->path1 = ; ?Op 6 dec 2023 om 20:59 heeft Lime, Steve D (MNIT) het volgende geschreven: IMHO, if you do a SHAPEPATH at the layer level then you might as well just add the full-path to the DATA element. You’re not really gaining anything with the additional complexity. Did the idea of using runtime variables not pan out? From: MapServer-users On Behalf Of Jan Hartmann via MapServer-users Sent: Wednesday, December 6, 2023 1:14 AM To: Steve Lime Cc: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] multiple shapepaths How about a shapepath at the layer level? I am combining 20 years of working with old maps in three (or four :-)) different countries (Netherlands, Germany and Flemish and Walloon Belgium), all in their own formats, projections, directories an servers. It would help to keep my applications (and my mind) clear if I could use the appropriate shapepaths. And as to portability, it is essential to use relative paths. Just try to move a website to a new server with a differently named filesystem, if all paths are hard coded. Jan Op 5 dec 2023 om 15:43 heeft Steve Lime <sdl...@gmail.com> het volgende geschreven: It won’t work. A configuration is loaded in entirety first, and then applied as necessary. On Tue, Dec 5, 2023 at 7:21 AM Jan Hartmann via MapServer-users <mapserver-users@lists.osgeo.org> wrote: Not sure. I cannot get it working anyway. Any ideas, Steve? On 04/12/2023 10:10, Jörg Thomsen (WhereGroup) via MapServer-users wrote: > Hi, > > I am not sure, but perhaps overwriting it, would work? > > MAP > > shapepath 'blah' > > Layer 1 > Layer 2 > > shapepath 'blubb' > > Layer 3 > Layer 4 > > Jörg > > > > Am 02.12.23 um 19:32 schrieb Jan Hartmann via MapServer-users: >> Yes, that is what I sought, didn't know it was possible. Thanks! >> >> Jan >> >> On 02/12/2023 19:29, Steve Lime wrote: >>> One other thought, you can use multiple paths via runtime subs to >>> approximate what I think you’re looking for, so: >>> >>> WEB >>> VALIDATION >>> path1_default “/opt/path1” >>> path1 “^\/opt\/path1$” >>> path2_default “/opt/path2” >>> path2 “^\/opt\/path2$” >>> END >>> END >>> >>> Then in DATA values you’d use %path1% or %path2%. This is another >>> use case for variables that was suggested recently. We could, >>> perhaps, define a way to mark something as immutable via url so the >>> regex could be simplified and only the default would ever be used >>> (e.g. “path2” “immutable”). >>> >>> —Steve >>> >>> On Fri, Dec 1, 2023 at 11:28 PM Steve Lime <sdl...@gmail.com> wrote: >>> >>> Nope, just the one value. >>> >>> On Fri, Dec 1, 2023 at 1:02 PM Jan Hartmann via MapServer-users >>> <mapserver-users@lists.osgeo.org> wrote: >>> >>> Hi, >>> >>> Is it possible to use multiple paths in a shapepath? >>> ./data1:./data2 >>> does not work >>> >>> Jan >>> ___ >>> MapServer-users mailing list >>> MapServer-users@lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> >> >> ___ >> MapServer-users mailing list >> MapServer-users@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] multiple shapepaths
No, this would make the file system on my server an even worse spaghetti mess than when I move the files physically under one root. I want to leave everything as distributed as possible. Cheers, Rich, Steve and all, Jan On 06/12/2023 14:21, Richard Greenwood wrote: How about just symlink in the file system? On Wed, Dec 6, 2023 at 12:14 AM Jan Hartmann via MapServer-users wrote: How about a shapepath at the layer level? I am combining 20 years of working with old maps in three (or four :-)) different countries (Netherlands, Germany and Flemish and Walloon Belgium), all in their own formats, projections, directories an servers. It would help to keep my applications (and my mind) clear if I could use the appropriate shapepaths. And as to portability, it is essential to use relative paths. Just try to move a website to a new server with a differently named filesystem, if all paths are hard coded. Jan Op 5 dec 2023 om 15:43 heeft Steve Lime het volgende geschreven: It won’t work. A configuration is loaded in entirety first, and then applied as necessary. On Tue, Dec 5, 2023 at 7:21 AM Jan Hartmann via MapServer-users wrote: Not sure. I cannot get it working anyway. Any ideas, Steve? On 04/12/2023 10:10, Jörg Thomsen (WhereGroup) via MapServer-users wrote: > Hi, > > I am not sure, but perhaps overwriting it, would work? > > MAP > > shapepath 'blah' > > Layer 1 > Layer 2 > > shapepath 'blubb' > > Layer 3 > Layer 4 > > Jörg > > > > Am 02.12.23 um 19:32 schrieb Jan Hartmann via MapServer-users: >> Yes, that is what I sought, didn't know it was possible. Thanks! >> >> Jan >> >> On 02/12/2023 19:29, Steve Lime wrote: >>> One other thought, you can use multiple paths via runtime subs to >>> approximate what I think you’re looking for, so: >>> >>> WEB >>> VALIDATION >>> path1_default “/opt/path1” >>> path1 “^\/opt\/path1$” >>> path2_default “/opt/path2” >>> path2 “^\/opt\/path2$” >>> END >>> END >>> >>> Then in DATA values you’d use %path1% or %path2%. This is another >>> use case for variables that was suggested recently. We could, >>> perhaps, define a way to mark something as immutable via url so the >>> regex could be simplified and only the default would ever be used >>> (e.g. “path2” “immutable”). >>> >>> —Steve >>> >>> On Fri, Dec 1, 2023 at 11:28 PM Steve Lime wrote: >>> >>> Nope, just the one value. >>> >>> On Fri, Dec 1, 2023 at 1:02 PM Jan Hartmann via MapServer-users >>> wrote: >>> >>> Hi, >>> >>> Is it possible to use multiple paths in a shapepath? >>> ./data1:./data2 >>> does not work >>> >>> Jan >>> ___ >>> MapServer-users mailing list >>> MapServer-users@lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> >> >> ___ >> MapServer-users mailing list >> MapServer-users@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -- Richard W. Greenwood www.greenwoodmap.com <http://www.greenwoodmap.com> ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] multiple shapepaths
How about a shapepath at the layer level? I am combining 20 years of working with old maps in three (or four :-)) different countries (Netherlands, Germany and Flemish and Walloon Belgium), all in their own formats, projections, directories an servers. It would help to keep my applications (and my mind) clear if I could use the appropriate shapepaths. And as to portability, it is essential to use relative paths. Just try to move a website to a new server with a differently named filesystem, if all paths are hard coded.JanOp 5 dec 2023 om 15:43 heeft Steve Lime het volgende geschreven:It won’t work. A configuration is loaded in entirety first, and then applied as necessary.On Tue, Dec 5, 2023 at 7:21 AM Jan Hartmann via MapServer-users <mapserver-users@lists.osgeo.org> wrote:Not sure. I cannot get it working anyway. Any ideas, Steve? On 04/12/2023 10:10, Jörg Thomsen (WhereGroup) via MapServer-users wrote: > Hi, > > I am not sure, but perhaps overwriting it, would work? > > MAP > > shapepath 'blah' > > Layer 1 > Layer 2 > > shapepath 'blubb' > > Layer 3 > Layer 4 > > Jörg > > > > Am 02.12.23 um 19:32 schrieb Jan Hartmann via MapServer-users: >> Yes, that is what I sought, didn't know it was possible. Thanks! >> >> Jan >> >> On 02/12/2023 19:29, Steve Lime wrote: >>> One other thought, you can use multiple paths via runtime subs to >>> approximate what I think you’re looking for, so: >>> >>> WEB >>> VALIDATION >>> path1_default “/opt/path1” >>> path1 “^\/opt\/path1$” >>> path2_default “/opt/path2” >>> path2 “^\/opt\/path2$” >>> END >>> END >>> >>> Then in DATA values you’d use %path1% or %path2%. This is another >>> use case for variables that was suggested recently. We could, >>> perhaps, define a way to mark something as immutable via url so the >>> regex could be simplified and only the default would ever be used >>> (e.g. “path2” “immutable”). >>> >>> —Steve >>> >>> On Fri, Dec 1, 2023 at 11:28 PM Steve Lime <sdl...@gmail.com> wrote: >>> >>> Nope, just the one value. >>> >>> On Fri, Dec 1, 2023 at 1:02 PM Jan Hartmann via MapServer-users >>> <mapserver-users@lists.osgeo.org> wrote: >>> >>> Hi, >>> >>> Is it possible to use multiple paths in a shapepath? >>> ./data1:./data2 >>> does not work >>> >>> Jan >>> ___ >>> MapServer-users mailing list >>> MapServer-users@lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> >> >> ___ >> MapServer-users mailing list >> MapServer-users@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] multiple shapepaths
Not sure. I cannot get it working anyway. Any ideas, Steve? On 04/12/2023 10:10, Jörg Thomsen (WhereGroup) via MapServer-users wrote: Hi, I am not sure, but perhaps overwriting it, would work? MAP shapepath 'blah' Layer 1 Layer 2 shapepath 'blubb' Layer 3 Layer 4 Jörg Am 02.12.23 um 19:32 schrieb Jan Hartmann via MapServer-users: Yes, that is what I sought, didn't know it was possible. Thanks! Jan On 02/12/2023 19:29, Steve Lime wrote: One other thought, you can use multiple paths via runtime subs to approximate what I think you’re looking for, so: WEB VALIDATION path1_default “/opt/path1” path1 “^\/opt\/path1$” path2_default “/opt/path2” path2 “^\/opt\/path2$” END END Then in DATA values you’d use %path1% or %path2%. This is another use case for variables that was suggested recently. We could, perhaps, define a way to mark something as immutable via url so the regex could be simplified and only the default would ever be used (e.g. “path2” “immutable”). —Steve On Fri, Dec 1, 2023 at 11:28 PM Steve Lime wrote: Nope, just the one value. On Fri, Dec 1, 2023 at 1:02 PM Jan Hartmann via MapServer-users wrote: Hi, Is it possible to use multiple paths in a shapepath? ./data1:./data2 does not work Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] multiple shapepaths
Yes, that is what I sought, didn't know it was possible. Thanks! Jan On 02/12/2023 19:29, Steve Lime wrote: One other thought, you can use multiple paths via runtime subs to approximate what I think you’re looking for, so: WEB VALIDATION path1_default “/opt/path1” path1 “^\/opt\/path1$” path2_default “/opt/path2” path2 “^\/opt\/path2$” END END Then in DATA values you’d use %path1% or %path2%. This is another use case for variables that was suggested recently. We could, perhaps, define a way to mark something as immutable via url so the regex could be simplified and only the default would ever be used (e.g. “path2” “immutable”). —Steve On Fri, Dec 1, 2023 at 11:28 PM Steve Lime wrote: Nope, just the one value. On Fri, Dec 1, 2023 at 1:02 PM Jan Hartmann via MapServer-users wrote: Hi, Is it possible to use multiple paths in a shapepath? ./data1:./data2 does not work Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[MapServer-users] multiple shapepaths
Hi, Is it possible to use multiple paths in a shapepath? ./data1:./data2 does not work Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] PHP Mapscript: how to clone layers
Yes, that's it. Thanks, Seth! It was an insidious migration problem. The old way of cloning a layer ($l2 = new layerObj($oMap,$l1);) still works, but ignores the second parameter. So you get a default new layer, with STATUS OFF. I filled every member but that. No wonder the layers didn't turn on. Could this function be made to fail when called with two parameters? On 26/11/2023 21:20, Seth G wrote: Hi Jan, I'm not a PHP MapScript user but you should be able to use: $l2 = $l1->cloneLayer(); As per the note at the following link - "In the Java & PHP modules this method is named cloneLayer. " https://mapserver.org/mapscript/mapscript-api/stub/mapscript.layerObj.html#mapscript.layerObj.clone I'm guessing there is a clash with the a reserved keyword in PHP so the method needs a different name. Seth -- web:https://geographika.net &https://mapserverstudio.net twitter: @geographika On Sun, Nov 26, 2023, at 7:38 PM, Jan Hartmann via MapServer-users wrote: Hi, In previous versions of PHP MapScript a new layer was defined as: $l2 = new layerObj($oMap,$l1); $l1 is the base layer from which $l2 is copied. In MapScript SWIG the second parameter has disappeared. $l2 has to be cloned from $l1, and then inserted into the map. With PHP-MapScript this should be: $l2 = $l1->clone(); $oMap->insertLayer($l2); But there is no PHP-MapScript function layerObj::clone. What do I miss? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[MapServer-users] PHP Mapscript: how to clone layers
Hi, In previous versions of PHP MapScript a new layer was defined as: $l2 = new layerObj($oMap,$l1); $l1 is the base layer from which $l2 is copied. In MapScript SWIG the second parameter has disappeared. $l2 has to be cloned from $l1, and then inserted into the map. With PHP-MapScript this should be: $l2 = $l1->clone(); $oMap->insertLayer($l2); But there is no PHP-MapScript function layerObj::clone. What do I miss? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] How to cascade data from OGC API Features service?
Hi Jukka, Sometimes there are problems when the actual filenames in the vrt are relative pathnames. Especially with the new mapscript.php include file. Perhaps you could try that. Jan On 13/11/2023 22:48, Rahkonen Jukka via MapServer-users wrote: Hi, I tried to make a WMS layer from OGC API Features service but I did not success. This is my best trial so far: I am using Mapserver from MS4W 5.0.0 RC1 I wrote this ORG VRT file (ogcfeat.vrt) OAPIF:https://beta-paikkatieto.maanmittauslaitos.fi/inspire-buildings/features/v1/ building The GDAL included in MS4W reads the vrt OK with ogrinfo ogcfeat.vrt -al -so --debug on (there are 5 millions polygons so hit Ctrl-C if you are just testing) I wrote a layer that can be at the bottom of this message below. The WMS GetCapabilities show the new layer but GetMaps fail. The log file collects these errors msDrawMap(): Image handling error. Failed to draw layer named 'building'. msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `building'. File not found or unsupported format. Check server logs. Open failed for OGR connection in layer `building'. Am I missing something from my configuration? My LAYER is like this LAYER NAME "building" STATUS ON CONNECTIONTYPE OGR CONNECTION "c:/ms4w_data/oapif.vrt" DATA "building" TYPE POLYGON # DEBUG 5 UNITS METERS SIZEUNITS PIXELS MAXSCALEDENOM 6 TOLERANCE 3 TOLERANCEUNITS PIXELS METADATA "wms_title" "OGCFeat-building" "wms_include_items" "all" END #metadata PROJECTION "init=epsg:3067" ##recommended END CLASS NAME "building" STYLE COLOR 200 255 200 OUTLINECOLOR 120 120 120 END # Style END # Class TEMPLATE "empty" ##recommended (enable GetFeatureInfo / can point to valid .html template) END # Layer -Jukka Rahkonen- ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] PHP-Mapscript: write imageObj to stdout
Yes, this works. Thanks Vassili and Sven. Is there any difference between getBytes() and msIO_getStdoutBufferBytes()? On 13/11/2023 09:51, Vassilis Chatzigiannakis via MapServer-users wrote: Yes, in php using swig it would be: $oImg = $this->oMap->draw(); echo $oImg->getBytes() -Original Message- From: MapServer-users On Behalf Of Sven Schroeter via MapServer-users Sent: Monday, November 13, 2023 10:44 AM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] PHP-Mapscript: write imageObj to stdout Hi Jan, maybe you need this: //SWIG if($mapscriptSwig) { echo msIO_getStdoutBufferBytes(); }else{ echo ms_iogetStdoutBufferBytes(); } Sven Am 10.11.2023 um 18:59 schrieb Jan Hartmann via MapServer-users: Hi, In previous versions of PHP-Mapscript there was a function ImageObj->saveImage(fn), that wrote an ImageObj to a file on disk. When fn was empty, the image was sent to stdout. In SWIG-Mapscript, this function has been replaced by ImageObj->save(fn), but fn cannot be empty anymore. How do I send an ImageObj directly to stdout (i.e. to the browser)? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[MapServer-users] PHP-Mapscript: write imageObj to stdout
Hi, In previous versions of PHP-Mapscript there was a function ImageObj->saveImage(fn), that wrote an ImageObj to a file on disk. When fn was empty, the image was sent to stdout. In SWIG-Mapscript, this function has been replaced by ImageObj->save(fn), but fn cannot be empty anymore. How do I send an ImageObj directly to stdout (i.e. to the browser)? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] Docker image for MapServer with PHP-MapScript
Thanks Steve. I should have been able to guess that, but the PHP-MapScript documentation (https://mapserver.org/mapscript/php/index.html) still has a metadata member for the MapObj. As well as for the WebObj As has been said before, the documentation for PHP Mapscript (https://mapserver.org/mapscript/php/index.html) is not very helpful. Essentially, it still describes the pre-SWIG version. I have been compiling MapServer since before the first marvelous MapServer-meeting in 2003 (https://maps.hisgis.nl/conferences/2003/mum/, look at the photographs!), but I have been using the UbuntuGIS version for the last few years. It was really a pain to get the current version working from scratch in a user directory. I was almost starting to think about switching to GeoServer :-). To get the "official" PHP-Mapscript-guide working I had to use: https://ms4w.com/trac/wiki/MigrationGuide5.x https://mapserver.org/MIGRATION_GUIDE.html https://mapserver.org/mapscript/php/migration_guide.html https://mapserver.org/mapscript/php/index.html The main new requirements (including mapscript.php and setting mapserver.conf) core-dump the PHP-script when missing, so that too leads to some not-so-nice debugging. I would strongly advise to bring the documentation of MapScript up to date and to base it on the most recent version. And to clean out a bit the remnants of previous releases. There seems to be a working Docker-version for MapServer/Mapscript in Debian Bookworm (https://lists.osgeo.org/pipermail/mapserver-dev/2023-October/017032.html), but I haven't tested it yet. Has anyone worked with it? And does anyone know of a recent Docker version for Mapserver/Mapscript in Alpine? Some organisations I am working for in the Euregio Aachen-Liege-Maastricht require Alpine for their Docker version. Anyway, thanks to Tanya, Vassilis and Steve, Jan Hartmann Amsterdam On 30/10/2023 18:56, Lime, Steve D (MNIT) wrote: Map-level metadata lives in the WEB object… *From:* MapServer-users *On Behalf Of *Jan Hartmann via MapServer-users *Sent:* Monday, October 30, 2023 12:46 PM *To:* Vassilis Chatzigiannakis ; mapserver-users@lists.osgeo.org *Subject:* Re: [MapServer-users] Docker image for MapServer with PHP-MapScript Almost there. There are additional migration examples in: https://ms4w.com/trac/wiki/MigrationGuide5.x I wrote wrapper functions for the old ms_new... functions, and can create that way a new mapObj called $oMap. The "set" function has been renamed to "__set" : not $oMap->set("maxsize",6020), but: ;$oMap->__set("maxsize",6020); Layers can be declared as before: $layer = $oMap->getLayer(1). Metadata have to be set as follows: Not: $layer->setMetadata("...","..."); but: $layer->metadata->set("...","...") However, I cannot set the metadata of the mapObj: $oMap->metadata->set("...","...") gives: "Undefined array key "metadata"" Any idea? On 29/10/2023 07:52, Vassilis Chatzigiannakis wrote: Yes the documentation is a mess . I worked with this reference: https://mapserver.org/mapscript/mapscript-api/index.html So, you start by $oMap= newmapObj($mapfile); Best regards, Vassilis *From:* Jan Hartmann <mailto:j.l.h.hartm...@gmail.com> *Sent:* Saturday, October 28, 2023 9:14 PM *To:* Vassilis Chatzigiannakis <mailto:vcha...@itml.gr>; mapserver-users@lists.osgeo.org *Subject:* Re: [MapServer-users] Docker image for MapServer with PHP-MapScript This seems to work. And it says so in the migration guide (https://mapserver.org/mapscript/php/migration_guide.html): all of your PHP scripts (that leverage MapServer objects and functions) must now always first include the generated mapscript.php file containing MapServer constants: But could it be that only "$m = new mapObj('...');" is accepted, and "$m=ms_newMapObj('...');" isn't? The docs still mention the old call (https://mapserver.org/mapscript/php/phpmapscript.html On 28/10/2023 09:11, Vassilis Chatzigiannakis wrote: Hi, I did it recently. There should be a mapscript.php file in the same folder as the php_mapscriptng.so extension. You need to include it in your php script. Best, Vassilis *From:* MapServer-users <mailto:mapserver-users-boun...@lists.osgeo.org> *On Behalf Of *Jan Hartmann via MapServer-users *Sent:* Friday, October 27, 2023 9:42 PM *To:* mapserver-users@lists.osgeo.org *Subject:* Re: [MapServer-users] Docker image for MapServer with PHP-MapScript I made a docker version of mapserver/php-mapscript myself, based on Ubuntu 22.04. I installed all required libraries with apt, and comp
Re: [MapServer-users] Docker image for MapServer with PHP-MapScript
Almost there. There are additional migration examples in: https://ms4w.com/trac/wiki/MigrationGuide5.x I wrote wrapper functions for the old ms_new... functions, and can create that way a new mapObj called $oMap. The "set" function has been renamed to "__set" : not $oMap->set("maxsize",6020), but: ;$oMap->__set("maxsize",6020); Layers can be declared as before: $layer = $oMap->getLayer(1). Metadata have to be set as follows: Not: $layer->setMetadata("...","..."); but: $layer->metadata->set("...","...") However, I cannot set the metadata of the mapObj: $oMap->metadata->set("...","...") gives: "Undefined array key "metadata"" Any idea? On 29/10/2023 07:52, Vassilis Chatzigiannakis wrote: Yes the documentation is a mess . I worked with this reference: https://mapserver.org/mapscript/mapscript-api/index.html So, you start by $oMap= newmapObj($mapfile); Best regards, Vassilis *From:* Jan Hartmann *Sent:* Saturday, October 28, 2023 9:14 PM *To:* Vassilis Chatzigiannakis ; mapserver-users@lists.osgeo.org *Subject:* Re: [MapServer-users] Docker image for MapServer with PHP-MapScript This seems to work. And it says so in the migration guide (https://mapserver.org/mapscript/php/migration_guide.html): all of your PHP scripts (that leverage MapServer objects and functions) must now always first include the generated mapscript.php file containing MapServer constants: But could it be that only "$m = new mapObj('...');" is accepted, and "$m=ms_newMapObj('...');" isn't? The docs still mention the old call (https://mapserver.org/mapscript/php/phpmapscript.html On 28/10/2023 09:11, Vassilis Chatzigiannakis wrote: Hi, I did it recently. There should be a mapscript.php file in the same folder as the php_mapscriptng.so extension. You need to include it in your php script. Best, Vassilis *From:* MapServer-users <mailto:mapserver-users-boun...@lists.osgeo.org> *On Behalf Of *Jan Hartmann via MapServer-users *Sent:* Friday, October 27, 2023 9:42 PM *To:* mapserver-users@lists.osgeo.org *Subject:* Re: [MapServer-users] Docker image for MapServer with PHP-MapScript I made a docker version of mapserver/php-mapscript myself, based on Ubuntu 22.04. I installed all required libraries with apt, and compiled mapserver and mapscript according to instructions. No problem at all. At the end I got the following from phpinfo(); mapscript *MapServer Version* MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.4 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But no mapscript function or object was regognized in my PHP-scripts: PHP Fatal error: Uncaught Error: Class "mapObj" not found in /virdir/www_root/test.php:2 Stack trace: #0 {main} thrown in /virdir/www_root/test.php on line 2 I am really desparate. Has anyone ever succeeded to get php_mapscriptng.so to work? Or does anyone know of a working Docker image for MapServer with PHP MapScript? Jan On 21/10/2023 05:40, Jan Hartmann wrote: I tried this with serveral versions of PHP and MapServer, but got always the same result. Can anyone point me to a Docker image for MapServer + PHP-MapScript? Jan On 19/10/2023 18:12, Jan Hartmann wrote: Still not there. Everything has been installed, and phpinfo() gives: *MapServer Version* MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.7 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But calling "$map = new mapObj('mapfile.map');" gives: *Fatal error*: Uncaught Error: Class "mapObj" not found in /mnt/virdir/www_root/test/test_mapscript.php:2 Stack trace: #0 {main} thrown in */mnt/virdir/www_root/test/test_mapscript.php* on line *2 *Any idea? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] Docker image for MapServer with PHP-MapScript
This seems to work. And it says so in the migration guide (https://mapserver.org/mapscript/php/migration_guide.html): all of your PHP scripts (that leverage MapServer objects and functions) must now always first include the generatedmapscript.phpfile containing MapServer constants: But could it be that only "$m = new mapObj('...');" is accepted, and "$m=ms_newMapObj('...');" isn't? The docs still mention the old call (https://mapserver.org/mapscript/php/phpmapscript.html On 28/10/2023 09:11, Vassilis Chatzigiannakis wrote: Hi, I did it recently. There should be a mapscript.php file in the same folder as the php_mapscriptng.so extension. You need to include it in your php script. Best, Vassilis *From:* MapServer-users *On Behalf Of *Jan Hartmann via MapServer-users *Sent:* Friday, October 27, 2023 9:42 PM *To:* mapserver-users@lists.osgeo.org *Subject:* Re: [MapServer-users] Docker image for MapServer with PHP-MapScript I made a docker version of mapserver/php-mapscript myself, based on Ubuntu 22.04. I installed all required libraries with apt, and compiled mapserver and mapscript according to instructions. No problem at all. At the end I got the following from phpinfo(); mapscript *MapServer Version* MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.4 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But no mapscript function or object was regognized in my PHP-scripts: PHP Fatal error: Uncaught Error: Class "mapObj" not found in /virdir/www_root/test.php:2 Stack trace: #0 {main} thrown in /virdir/www_root/test.php on line 2 I am really desparate. Has anyone ever succeeded to get php_mapscriptng.so to work? Or does anyone know of a working Docker image for MapServer with PHP MapScript? Jan On 21/10/2023 05:40, Jan Hartmann wrote: I tried this with serveral versions of PHP and MapServer, but got always the same result. Can anyone point me to a Docker image for MapServer + PHP-MapScript? Jan On 19/10/2023 18:12, Jan Hartmann wrote: Still not there. Everything has been installed, and phpinfo() gives: *MapServer Version* MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.7 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But calling "$map = new mapObj('mapfile.map');" gives: *Fatal error*: Uncaught Error: Class "mapObj" not found in /mnt/virdir/www_root/test/test_mapscript.php:2 Stack trace: #0 {main} thrown in */mnt/virdir/www_root/test/test_mapscript.php* on line *2 *Any idea? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] Docker image for MapServer with PHP-MapScript
I made a docker version of mapserver/php-mapscript myself, based on Ubuntu 22.04. I installed all required libraries with apt, and compiled mapserver and mapscript according to instructions. No problem at all. At the end I got the following from phpinfo(); mapscript MapServer Version MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.4 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But no mapscript function or object was regognized in my PHP-scripts: PHP Fatal error: Uncaught Error: Class "mapObj" not found in /virdir/www_root/test.php:2 Stack trace: #0 {main} thrown in /virdir/www_root/test.php on line 2 I am really desparate. Has anyone ever succeeded to get php_mapscriptng.so to work? Or does anyone know of a working Docker image for MapServer with PHP MapScript? Jan On 21/10/2023 05:40, Jan Hartmann wrote: I tried this with serveral versions of PHP and MapServer, but got always the same result. Can anyone point me to a Docker image for MapServer + PHP-MapScript? Jan On 19/10/2023 18:12, Jan Hartmann wrote: Still not there. Everything has been installed, and phpinfo() gives: MapServer Version MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.7 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But calling "$map = new mapObj('mapfile.map');" gives: *Fatal error*: Uncaught Error: Class "mapObj" not found in /mnt/virdir/www_root/test/test_mapscript.php:2 Stack trace: #0 {main} thrown in*/mnt/virdir/www_root/test/test_mapscript.php*on line*2 *Any idea? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[MapServer-users] Docker imgage for MapServer with PHP-MapScript
I tried this with serveral versions of PHP and MapServer, but got always the same result. Can anyone point me to a Docker image for MapServer + PHP-MapScript? Jan On 19/10/2023 18:12, Jan Hartmann wrote: Still not there. Everything has been installed, and phpinfo() gives: MapServer Version MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.7 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But calling "$map = new mapObj('mapfile.map');" gives: *Fatal error*: Uncaught Error: Class "mapObj" not found in /mnt/virdir/www_root/test/test_mapscript.php:2 Stack trace: #0 {main} thrown in*/mnt/virdir/www_root/test/test_mapscript.php*on line*2 *Any idea? Jan ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[MapServer-users] Installing PHP-MapScript from source
Still not there. Everything has been installed, and phpinfo() gives: MapServer Version MapServer version 8.0.1 PROJ version 9.3 GDAL version 3.7 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF But calling "$map = new mapObj('mapfile.map');" gives: *Fatal error*: Uncaught Error: Class "mapObj" not found in /mnt/virdir/www_root/test/test_mapscript.php:2 Stack trace: #0 {main} thrown in*/mnt/virdir/www_root/test/test_mapscript.php*on line*2 *Any idea? Jan___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] Compiling mapserver with php in user directory
Hi Jeff, I appreciate your advice, but I solved the problem with a hack, and to be honest, CMAKE error handling is above me. I am still from the ./configure generation :-) I added these two lines to MapServer's CMAKE call: -DPHP_INCLUDE_PATH=$INSTALLBIN/include/php/main \ -DPHP_EXTENSION_DIR=$INSTALLBIN/lib/php/extensions/no-debug-non-zts-20220829 I also had to add these lines to GEOS's CMAKE, after -DCMAKE_INSTALL_PREFIX=$INSTALLBIN -DCMAKE_PREFIX_PATH=$INSTALLBIN \ -DCMAKE_LIBRARY_PATH=$INSTALLBIN/lib \ -DINCLUDE_DIRECTORIES=$INSTALLBIN/include \ I guess CMAKE does not propagate its dependencies very well from the general INSTALL_PREFIX. But this still didn't work. The php includes in other subdirectories than main weren't found. Those subdirectories should have been added to the include path, but weren't. So I copied the complete php include directory to /usr/include (O horror! :-)) . Of course a Docker installation would be easier, as you can install everything in standard locations. But I want to have a real dedicated server with just the software I need and nothing more. I have worked for a long time with the UbuntuGIS packages, but they are not supported very well. Thanks for your advice! Jan On 18/10/2023 19:11, Jeff McKenna via MapServer-users wrote: Hi Jan, I understand that you won't listen to my advice here, no problem at all. But I won't repeat myself here Enjoy your afternoon, -jeff On 2023-10-18 1:39 p.m., Jan Hartmann wrote: I compiled with: -DPHP_INCLUDE_DIR=$INSTALLBIN/include/php \ -DPHP_EXTENSION_DIR=$INSTALLBIN/lib/php/extensions/no-debug-non-zts-20220829 and got lots of error messages about missing .h files (php.h, zend.h etc). I bulk copied them all to the directory in the build tree where the errors came from, and got a complete build, including "php_mapscriptng.so" So CMAKE is still missing the php include directories. What is de correct DEFINE for that? After I copied php_mapscriptng.so to the correct location and filling in php.ini, I got a warning when starting PHP : Startup: Unable to load dynamic library 'php_mapscriptng.so' (tried: /virdir/installbin/lib/php/extensions/no-debug-non-zts-20220829/php_mapscriptng.so (libgeos.so.3.12.0: cannot open shared object file: No such file or directory) But it *is* in that location. Any idea? On 17/10/2023 21:45, Jeff McKenna via MapServer-users wrote: Hi Jan, Unfortunately I have much experience tracking down CMake errors now, ha. Instead of the error log, scroll up and read the output from your cmake command (as it does its checks and looks for libraries), I find examining that output is crucial (and I personally find the actual generated log file is filled of fake/"red-herrings"). Focus instead on going line-by-line through that cmake output, as it makes its way down to the final "configuring incomplete" message. (for packaging, this is what I do, line-by-line) For example, if you are trying to enable the GEOS library, I would go line-by-line of the output and find where it was looking for GEOS initially, and read the messages in that section, to confirm that there are no issues when enabling GEOS. This is crucial. It takes much time to do this for each library. In my case, for PHPNG support, my CMake command includes: "-DWITH_PHPNG=1 -DPHP_EXTENSION_DIR=/usr/lib/php/20220829" In your case I am not sure, but, I would start by examining line-by-line the CMake output before the words "Configuring incomplete" (and totally ignoring the generated 'output' file). Maybe you can find the PHPNG section in your cmake command output, and paste that here for the community to review. -jeff ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MapServer-users] Compiling mapserver with php in user directory
I compiled with: -DPHP_INCLUDE_DIR=$INSTALLBIN/include/php \ -DPHP_EXTENSION_DIR=$INSTALLBIN/lib/php/extensions/no-debug-non-zts-20220829 and got lots of error messages about missing .h files (php.h, zend.h etc). I bulk copied them all to the directory in the build tree where the errors came from, and got a complete build, including "php_mapscriptng.so" So CMAKE is still missing the php include directories. What is de correct DEFINE for that? After I copied php_mapscriptng.so to the correct location and filling in php.ini, I got a warning when starting PHP : Startup: Unable to load dynamic library 'php_mapscriptng.so' (tried: /virdir/installbin/lib/php/extensions/no-debug-non-zts-20220829/php_mapscriptng.so (libgeos.so.3.12.0: cannot open shared object file: No such file or directory) But it *is* in that location. Any idea? On 17/10/2023 21:45, Jeff McKenna via MapServer-users wrote: Hi Jan, Unfortunately I have much experience tracking down CMake errors now, ha. Instead of the error log, scroll up and read the output from your cmake command (as it does its checks and looks for libraries), I find examining that output is crucial (and I personally find the actual generated log file is filled of fake/"red-herrings"). Focus instead on going line-by-line through that cmake output, as it makes its way down to the final "configuring incomplete" message. (for packaging, this is what I do, line-by-line) For example, if you are trying to enable the GEOS library, I would go line-by-line of the output and find where it was looking for GEOS initially, and read the messages in that section, to confirm that there are no issues when enabling GEOS. This is crucial. It takes much time to do this for each library. In my case, for PHPNG support, my CMake command includes: "-DWITH_PHPNG=1 -DPHP_EXTENSION_DIR=/usr/lib/php/20220829" In your case I am not sure, but, I would start by examining line-by-line the CMake output before the words "Configuring incomplete" (and totally ignoring the generated 'output' file). Maybe you can find the PHPNG section in your cmake command output, and paste that here for the community to review. -jeff ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[MapServer-users] Compiling mapserver with php in user directory
Hi all, I am trying to compile MapServer with all dependencies in a separate user-directory. Everything has been compiled with —prefix=$INSTALLBIN. PHP has also been compiled into that directory, but I don't get MapServer to use it. It compiles against the system-php, but that is another version than the compiled one. I call CMAKE with the following options: ... -DGDAL_LIBRARY=$INSTALLBIN/lib/libgdal.so \ -DGDAL_INCLUDE_DIR=$INSTALLBIN/include \ ... I removed the sysem-PHP, and added -DPHP_INCLUDE_DIR=$INSTALLBIN/include/php \, but that doesn't work, and I cannot find the PHP-library to add. CMAKE ends with the message: "Configuring incomplete, errors occurred!", without giving the precise errors. In the error log I get messages of missing "strrstr", "strlcat" and strlcpy". Can you help me? Jan Hartmann Amsterdam ___ MapServer-users mailing list MapServer-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users