The Windows Open Source Developer Diaries–Installing stuff

< Previous: The Windows Open Source Development Diaries – The beginning

For those of you who read my previous post on this subject you might have noticed the extra ‘Windows” on the title. Just to make it clear that all these posts refer to windows installations only. Something that it proved all too important when I was trying to install all the different components.

Geoserver installation

I installed  Geoserver 2.2-RC as this is the required version according to the Cartaro documentation Used the Windows Installer following the steps outlined here and accepting most of the default options. I only changed the port number to 8082 from the default 8080 and selected to start Geoserver manually rather than installing it as a Windows service. Installed nicely without the slightest problem. Game on!

It almost went toooo smoothly… I mean I thought I would have to install Apache Tomcat or similar. But looking the windows services revealed nothing. So which web server was Geoserver using? I then found this in the Windows Binary topic in the Geoserver documentation:

The most common way to install GeoServer is using the OS-independent binary. This version is a GeoServer web application (webapp) bundled inside Jetty, a lightweight servlet container system. It has the advantages of working very similarly across all operating systems plus being very simple to set up.

Right. So this sorted this “automagic” mystery. You can actually see the reference to Jetty in the startup.bat file under the [Geoserver_install]\bin folder. So guess in retrospect, it was a good choice not to install as a windows service. Less of a black box.

PostGIS installation

Ok, this is where I cheat a bit. Postgres 9.1 and PostGIS 1.5 were already installed on my laptop so I wont be covering their installation here. However, in my experience installing on Windows is dead easy. You can simply  follow the installation wizard and accept the default options. PostGIS is now included in the Postgres installation as an option, so you can install both in a single step. You can find more information here and download the Windows installer here.

Installing Cartaro

I have to say I found the Cartaro and Drupal documentation a bit chaotic. All the information is there (or most of it anyway), but its all over the place. And as it sometimes happens for OS s/w, Windows-specific documentation is a bit scarce. The actual documentation on the Cartaro site, states that the install guide is based on “Ubuntu Precise (12.04 LTS)”, whatever that is, and that  “You might need to adapt commands depending on your Linux distribution”. Err… ok then. I knew there and then that I was in for a lot of fun…

But hey, at least there is a Cartaro distribution for Windows (basically a zip file). The install.txt file in the zip file, says it requires a web server like Apache (version 2.0 or greater) is and PHP 5.2.4 (or greater). This actually proved to be wrong. It requires the 5.2.11 version. But you only find about this later as I was soon to find out.

Being lazy, I thought the easiest way to install Apache and PHP in one go was to use the OSGeo4W installer Which I did and selected only these two apps to download. The Apache server on the installer is 2.2.14-4 and PHP on 5.2.5. Assumed –incorrectly as it turned out- that these would do the trick.

The OS4GeoW installation created an “Apache OSGeo4W WebServer” windows service. But it didn’t start. I had seen this before and it was because I had IIS Server and they both trying to run on the same port (80). The solution was simple: Went to my Apache install folder and opened the httpd.conf file (in my installation: C:\OSGeo4W\apache\conf.\httpd.conf) Then I edited the file changing the line reading Listen 80 to Listen 8081. Apache now started fine. Cool. Next step was to install Cartaro itself.

Having being spoiled by Geoserver and Postgres/PostGIS and their excellent windows installers I tried to find a package windows installer. I found Acquia and some others but none were specific for Cartaro and most of them were based on MySQL. Just for reference the windows installation instructions (for Drupal in general, NOT Cartaro) can be found here.

In the end I simply unzipped the contents of the installation file under my htdocs Apache folder  (in my installation C:\OSGeo4W\apache\htdocs) under a folder called CartaroInstall. Restarted Apache, opened my browser, typed http://localhost/8081/CartaroInstall  and was welcomed by this soothing page:


Surely I am almost there?

Before I continued I had to create and edit the settings.php file as outlined here. The document speaks about setting the correct permissions in the settings.php file so until I knew know exactly what I am doing I gave full control to Everyone (this is just a local site after all) as below:


Went back to the install page, clicked on “Save and Continue” and got this- oops!image

Ok, so it looked like some PHP extensions were not enabled. To enable them, I edited the php.ini file (located under C:\OSGeo4W\apache\bin in my installation) and uncommented these lines:

  • extension=php_gd2.dll
  • extension=php_mbstring.dll

I repeated the previous steps, restarting Apache etc., and now got this:


SQL Lite??

It turned out I had to edit php.ini again and uncomment this line:  extension=php_pdo_pgsql.dll

This time things looked better:


Entered my postgis connection details using the default ‘postgres’ user and clicked “Save and continue”. Well, not so fast:


Now its telling me!! Might be a nice to have a note SOMEWHERE. Argh! Anyway, I headed over to  PHP Releases and downloaded 5.2.11 from

I then unzipped all the files into the C:\OSGeo4W\apache\php folder.

Note: Since PHP was originally installed with the OSGeo4W installer, I moved the files below in the C:\OSGeo4W\bin  folder.


This time I thought I was on a winner as it seemed that it was installing things…


But then I got this error:


I checked the Apache error log file (C:\OSGeo4W\apache\logs\error.log) The error was the incomprehensible:

PHP Parse error:  syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ‘)’ in C:\\OSGeo4W\\apache\\htdocs\\CartaroInstall\\profiles\\cartaro\\modules\\contrib \\geoserver\\geoserver_ui\\plugins\\export_ui\\ on line 126, referer: http://localhost:8081/CartaroInstall/install.php

Excuse me? unexpected T_PAAMAYIM_NEKUDOTAYIM??!! What on earth does that mean? Seemed it was a bug but the first reference I found about this specific for Drupal did not offer any real solutions: But then I found this little piece of gem on Stackoverflow: 

Apparently Paamayim Nekudotayim is Hebrew and stands for “twice colon” or “double colon” (Hebrew: פעמיים נקודתיים‎. There you go. Picking up foreign languages in the process!

And so I changed line126 in the file from:

‘#options’ => $layer_type_name::get_sources(),  to ‘#options’ => $layer_type_name->get_sources(),

And that got me into the next and final step:


Now, the Cartaro documentation states that:

GeoServer contains a default admin account with username “admin” and password “geoserver”. Either use this account when installing Cartaro, or adapt the account to match your Drupal admin account. 

And also to:

Ensure that your Drupal credentials match up with the credentials for GeoServer because Drupal users will be authenticated with GeoServer on login (this allows for protected layers and GeoServer administration from Drupal)

So I put the default geoserver username and password (admin/geoserver),


and clicked on ‘Save and Continue’. This time everything seemed to work ok. I had Cartaro installed. Hurrah!


I didn’t worry too much about the email error as I guess this is expected. Will need to configure the PHP mail settings at some point. Clicked on the Visit your new site link and got this nice page:


Looking good. Next step is to configure my new site and add a few maps. Stay tuned!


The Windows Open Source Developer diaries–The beginning

Next: The Windows Open Source Developer Diaries–Installing stuff >

I don’t class myself as an Open Source developer really. I have used Open Source GIS in a few occasions but it was always been the Windows flavour. I never used any Linux distributions nor have I written/contributed a single line of code even for the windows version of these software. My only claim in the Open Source development world is the development of the Silverlight Interface for Mapserver and a couple of linear referencing functions for for SQL Server Spatial Tools. Still very Microsoft focused as you can tell.

I always wanted to work on an application with a complete open source stack but never had the opportunity/time. Until now that is.

Because just the other day, I have been asked to investigate the necessary technologies to create an open source web-editing application and build a proof of concept prototype. Fantastic! Just what I’ve been waiting for.

The application should be running on Windows (yes- still windows-focused) and require login for different users/roles so I guess I would be needing a Geospatial CMS and for now at least, my first try would be Cartaro. Cartaro is a Drupal distribution using PostGIS, GeoServer and OpenLayers, all of them quite mature on their windows versions.

I have worked with PostGIS and I am pretty confident with it to deliver what’s needed. On the other hand, I never used GeoServer and have very limited javascript experience. I would assume though that I would not need to jump into too deep with Geoserver as I would only use it to setup my map services (right?).The things I am a bit worried about to be honest, are OpenLayers as it would require to get my teeth into javascript, and also whether all these technologies would work nicely together especially in a windows environment. I have been on record before as saying that a lot of times FOSS seem to leave windows users behind…

So this will be a series of posts probably weekly, day job permitting, recording my experiences while I download and install things, trying to to make them work and the frustrations and tribulations I am sure I will experience! This will then serve as a nice reference for me and hopefully help others willing to go the same path. You may see me in forums asking questions or on twitter sharing my thoughts. And of course feel free to leave any comments on this and the next posts especially if you notice I have taken any wrong turns!

Let the games begin…

Next: The Windows Open Source Developer Diaries–Installing stuff >