| 1 | = Build MapServer on Linux = |
| 2 | |
| 3 | General information on Unix builds can be found in the UNIX Compilation and Installation HOWTO: |
| 4 | |
| 5 | http://mapserver.gis.umn.edu/doc/unix-install-howto.html |
| 6 | |
| 7 | See also the MapServerCompilation page which contains links to detailed instructions for various platforms and MapServer versions. |
| 8 | |
| 9 | = Build PHPMapScript on Linux = |
| 10 | |
| 11 | Also see PHPBuildDebugLinux. The PHPMapScript page also contains links to other resources including detailed instructions for specific platforms such as RedHat? and Debian. |
| 12 | |
| 13 | Compiling MapServer and PHPMapScript in Spanish language is available on SpanishLinuxInstall. |
| 14 | |
| 15 | I finally have this all working after a long ordeal. But before I go into the details, I want to give public THANKS to Daniel Morissette of DM Solutions Group. He provided significant support and advice that enabled me to work through many issues. I seems straight forward after the fact, but it was not intuitive and I seemed to have turn down every dead end that exsisted. So Daniel, Thanks!, your assistance is greatly apreaciated. |
| 16 | |
| 17 | Now the details before they escape my seive of brain. |
| 18 | |
| 19 | My configuration: |
| 20 | RedHat 6.2, Linux 2.2.18 |
| 21 | apache_1.3.22.tar.gz |
| 22 | php-3.0.18.tar.gz |
| 23 | mapServer 3.5 Released |
| 24 | |
| 25 | I made scripts with all the configure parameters so I could have some repeatability and to verify what I actually ran last. I also did a "make clean" and "rm config.cache" in the scripts so when I made changes I was sure they were used. |
| 26 | |
| 27 | Here are a few of the problems that I ran into: |
| 28 | |
| 29 | 1) building things as DSO is very different than build things as static or CGI. After I got PHP3 built for debugging and found out that my multiple version of regex was causing memory structures to be miss-aligned, it still took me another half a day to get a working version to build. And worst of all the interdependance between apache/php3/mapscript is pathological at best. |
| 30 | |
| 31 | 2) TOO many versions of regex! There is one bundled with apache, another one bundled with php3, a system version (regex.h) and an rx lib version. Everybody needs to use the SAME version. I could ONLY get things to work when I forced everyone to use the system-regex. First off if you read the WMS documentation it talks about rx lib, just forget about this (IE: Dont down load it! I did and had to uninstall it to get mapserver to build in the first place). This required finding and setting --disable-rule=WANTHSREGEX=no in apache so it does not use its bundled version. |
| 32 | |
| 33 | For PHP3, if you are building the CGI version then you can specify --with-system-regex and your home free, BUT if your building a DSO with --with-apxs=/usr/sbin/apxs then it will look at the /usr/sbin/apxs to see if apache was built with its bundled regex and if it was then it will ignore the --with-system-regex. Also when you configure mapserver, it will look at the php's config.h file to determine if it should use the php bundled version of regex or not. |
| 34 | |
| 35 | 3) Build PHP3 as a DSO. There is a nasty problem that apxs is broken. This is easily fixed if you edit /usr/sbin/apxs and search for "-shared" and insert before it "-export-dynamic " before you run make on php3. Also be aware that if you rebuild and install apache it you will need to fix apxs again. |
| 36 | |
| 37 | 4) All the options as defined in ./configure --help do NOT work correctly or are ignored because of other conditions which allow you to easily get very confused. For example, --without-apxs or --with-apxs=no do not work, --without-system-regex does not work There may have been others, but I can't remember. |
| 38 | |
| 39 | 5) Open Issues: |
| 40 | |
| 41 | a) I never got the CGI version of PHP3 to work with my build of apache. b) When I build apache using the config below php4 broke and I have not gone back to look into that issue. |
| 42 | |
| 43 | So like I said, it seems pretty simple in hindsight, but I had spent the better part of 5 days over the last 2 weeks working on this. It was easier to set up my Linux firewall :) |
| 44 | |
| 45 | My scripts for apache, php3 and mapserver follow: |
| 46 | |
| 47 | [woodbri@linus linux]$ cat doit-apache |
| 48 | make clean |
| 49 | rm config.cache |
| 50 | ./configure |
| 51 | --enable-module=all |
| 52 | --enable-shared=max |
| 53 | --with-layout=RedHat |
| 54 | --disable-rule=WANTHSREGEX=no |
| 55 | make |
| 56 | |
| 57 | [woodbri@linus linux]$ cat doit-php3 |
| 58 | make clean |
| 59 | rm config.cache |
| 60 | ./configure |
| 61 | --prefix=/usr |
| 62 | --with-config-file-path=/etc/httpd |
| 63 | --enable-safe-mode |
| 64 | --enable-versioning |
| 65 | --with-apxs=/usr/sbin/apxs |
| 66 | --enable-force-cgi-redirect |
| 67 | --enable-discard-path |
| 68 | --with-exec-dir=/usr/bin |
| 69 | --with-system-regex |
| 70 | --with-zlib |
| 71 | --with-gdbm |
| 72 | --disable-debug |
| 73 | --enable-debugger |
| 74 | --enable-magic-quotes |
| 75 | --enable-track-vars |
| 76 | --enable-sysvsem |
| 77 | --enable-sysvshm |
| 78 | --enable-track-vars |
| 79 | --with-xml |
| 80 | --with-ftp |
| 81 | --with-jpeg |
| 82 | --without-ttf |
| 83 | --with-gd |
| 84 | --with-mysql=/usr |
| 85 | make |
| 86 | make install |
| 87 | |
| 88 | [woodbri@linus mapserver]$ cat doit-3.5 |
| 89 | make clean |
| 90 | rm config.cache |
| 91 | ./configure |
| 92 | --with-perl-options=PREFIX=/usr |
| 93 | --with-ogr --with-gdal |
| 94 | --with-wmsclient |
| 95 | --with-proj |
| 96 | --with-php=/home/woodbri/linux/php-3.0.18 |
| 97 | --with-apxs=/usr/sbin/apxs |
| 98 | make |