| 1 | = RedHat8AndMapserver37 = |
| 2 | |
| 3 | == Known Problems == |
| 4 | |
| 5 | 17 March 2004 |
| 6 | |
| 7 | A solution to the problem below is to edit php.ini: |
| 8 | |
| 9 | {{{ |
| 10 | # cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's |
| 11 | # previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok |
| 12 | # what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting |
| 13 | # this to 1 will cause PHP CGI to fix it's paths to conform to the spec. A setting |
| 14 | # of zero causes PHP to behave as before. Default is zero. You should fix your scripts |
| 15 | # to use SCRIPT_FILENAME rather than PATH_TRANSLATED. |
| 16 | cgi.fix_pathinfo = 1 |
| 17 | }}} |
| 18 | |
| 19 | 27 June 2003 |
| 20 | |
| 21 | o Sometimes when compiling PHP with the ./configure options outlined below (particularly the --enable-discard-path), a problem arises with PHP. When you run phpinfo() PHP produces error's like: |
| 22 | |
| 23 | **Warning: Unexpected character in input: '' (ASCII=24) state=1 in |
| 24 | **/var/www/cgi-bin/php on line 686 |
| 25 | |
| 26 | ***Warning: Unexpected character in input: '' (ASCII=8) state=1 in |
| 27 | ***/var/www/cgi-bin/php on line 686 |
| 28 | ***... |
| 29 | ***Parse error: parse error in /usr/local/apache/cgi-bin/php |
| 30 | |
| 31 | As a work around to this problem you can compile PHP without the --enable-discard-path option and it seems to work fine. Please be aware |
| 32 | that this option provides the following functionality and leaving this option from the configure string disables this: |
| 33 | |
| 34 | --enable-discard-path If this is enabled, the PHP CGI binary can safely be placed outside of the web tree and people |
| 35 | will not be able to circumvent .htaccess security." |
| 36 | |
| 37 | 06 APR 2003 |
| 38 | |
| 39 | o There appears to be a problem with threads. gc |
| 40 | o The PHP-4.3.0 bug appears to be fixed in 4.3.2RC1. I've not checked for a later version (yet). gc |
| 41 | |
| 42 | 20 Feb 2003 |
| 43 | |
| 44 | o There is a problem that PHP/Mapscript? process does not terminate or take a long time to terminate. - no work around at this time |
| 45 | o If you are using OUTPUTFORMAT descriptions, you need to have an IMAGETYPE <type> command in your mapfile or it will select some internal default - probably not what you want. This should change shortly in CVS. |
| 46 | o PHP-4.3.0 has a serious security issue, you should use PHP-4.3.1 |
| 47 | o PHP-4.3.x built as a CGI module (required for mapscript) has a bug that causes PHP_SELF to get clobbered. This should be fixed in CVS and PHP-4.3.2. I fixed this by creating an auto_prepend.php file the contained: |
| 48 | |
| 49 | <?php |
| 50 | ///// Quick fix until the PHP guys fix $_SERVER['PHP_SELF'] ///// |
| 51 | $_SERVER['SCRIPT_NAME'] = substr($_SERVER['PATH_TRANSLATED'], |
| 52 | strlen($_SERVER['DOCUMENT_ROOT'])); |
| 53 | |
| 54 | if (substr($_SERVER['SCRIPT_NAME'], 0, 2) == '//') { |
| 55 | $_SERVER['SCRIPT_NAME'] = substr($_SERVER['SCRIPT_NAME'], 1); |
| 56 | } |
| 57 | |
| 58 | $PHP_SELF = $SCRIPT_NAME = $_SERVER['PHP_SELF'] = |
| 59 | $_SERVER['SCRIPT_NAME']; |
| 60 | ///////////////////////////////////////////////////////////////// |
| 61 | ?> |
| 62 | |
| 63 | == Build Notes == |
| 64 | |
| 65 | # Here are my build notes for installing Mapserver et al on RH 8.0 |
| 66 | # many thanks to Vincent Schut for his build notes |
| 67 | |
| 68 | |
| 69 | # removed these and dependent rpms |
| 70 | rpm -e gd |
| 71 | rpm -e curl-7.9.8-1 |
| 72 | rpm -e curl-devel-7.9.8-1 |
| 73 | rpm -e php |
| 74 | |
| 75 | # already have rpm installed |
| 76 | rpm -q libpng-1.2.2-8 |
| 77 | rpm -q libpng-devel-1.2.2-8 |
| 78 | rpm -q libjpeg-6b-21 |
| 79 | rpm -q libjpeg-devel-6b-21 |
| 80 | |
| 81 | # installed |
| 82 | rpm -i pdflib-4.0.1-1.i386.rpm |
| 83 | |
| 84 | # download and build ming |
| 85 | tar xzf ming-0.2a.tgz |
| 86 | cd ming-0.2a |
| 87 | make |
| 88 | make static |
| 89 | make install |
| 90 | |
| 91 | # download and build curl |
| 92 | tar xzf curl-7.10.3.tar.gz |
| 93 | cd curl-7.10.3 |
| 94 | ./configure |
| 95 | make |
| 96 | make install |
| 97 | |
| 98 | # add /usr/local/lib to /etc/ld.so.conf |
| 99 | /sbin/ldconfig |
| 100 | |
| 101 | # download and install gd-2 into /usr/local |
| 102 | rm -f /usr/lib/libgd.* # to remove any potentially conflicts |
| 103 | tar xzf gd-2.0.11.tar.gz |
| 104 | cd gd-2.0.11 |
| 105 | ./configure |
| 106 | make |
| 107 | make install |
| 108 | |
| 109 | # download and install gdal-1.1.8 |
| 110 | tar xzf gdal-1.1.8.tar.gz |
| 111 | cd gdal-1.1.8 |
| 112 | ./configure \ |
| 113 | --with-libz \ |
| 114 | --with-png \ |
| 115 | --with-libtiff=internal \ |
| 116 | --with-geotiff=internal \ |
| 117 | --with-jpeg \ |
| 118 | --without-jasper \ |
| 119 | --without-python |
| 120 | make |
| 121 | make ogr-all |
| 122 | make install |
| 123 | |
| 124 | /sbin/ldconfig |
| 125 | |
| 126 | # download and build php-4.3.0 |
| 127 | tar xzf php-4.3.0.tar.gz |
| 128 | cd php-4.3.0 |
| 129 | rm -f config.cache |
| 130 | ./configure \ |
| 131 | --enable-force-cgi-redirect \ |
| 132 | --enable-discard-path \ |
| 133 | --with-config-file-path=/etc/httpd/ \ |
| 134 | --with-gd=/usr/local \ |
| 135 | --with-jpeg-dir \ |
| 136 | --with-png-dir \ |
| 137 | --with-zlib-dir \ |
| 138 | --with-freetype-dir \ |
| 139 | --without-ttf \ |
| 140 | --with-pdflib \ |
| 141 | --with-mysql \ |
| 142 | --with-regex=system \ |
| 143 | --with-ming \ |
| 144 | --enable-dbase \ |
| 145 | --enable-dbx \ |
| 146 | --enable-versioning |
| 147 | |
| 148 | |
| 149 | make |
| 150 | cp sapi/cgi/php /var/www/cgi-bin |
| 151 | make install |
| 152 | cp php.ini-dist /etc/httpd/php.ini |
| 153 | # change the following as appropriate |
| 154 | diff /etc/httpd/php.ini php.ini-dist |
| 155 | 423c423 |
| 156 | < extension_dir = /etc/httpd/php_mods |
| 157 | --- |
| 158 | > extension_dir = ./ |
| 159 | |
| 160 | |
| 161 | # download and build proj libraries |
| 162 | tar xzf proj-4.4.5.tar.gz |
| 163 | cd proj-4.4.5/nad |
| 164 | tar xzf ../../proj-nad27-1.1.tar.gz |
| 165 | cd .. |
| 166 | ./configure |
| 167 | make |
| 168 | make install |
| 169 | |
| 170 | /sbin/ldconfig |
| 171 | |
| 172 | |
| 173 | # download and build mapserver-3.7 |
| 174 | |
| 175 | tar xzf mapserver-3.7.tgz |
| 176 | cd mapServer-3.7 |
| 177 | rm -f config.cache |
| 178 | ./configure \ |
| 179 | --without-tiff \ |
| 180 | --without-eppl \ |
| 181 | --without-jpeg \ |
| 182 | --with-threads \ |
| 183 | --with-proj \ |
| 184 | --with-gdal=/usr/local/bin \ |
| 185 | --with-php=../php-4.3.0 \ |
| 186 | --with-gd=/usr/local \ |
| 187 | --with-freetype=/usr/bin \ |
| 188 | --with-pdf \ |
| 189 | --with-ogr \ |
| 190 | --with-gdal \ |
| 191 | --with-ming \ |
| 192 | --with-wmsclient \ |
| 193 | --with-wfs \ |
| 194 | --with-wfs-client |
| 195 | |
| 196 | # I got an undefined "_snprintf" which required changing |
| 197 | # mswmslayer.c to #include <stdio.h> |
| 198 | # and replace "_snprintf" with "snprintf" |
| 199 | |
| 200 | make |
| 201 | # DO NOT do a "make install" |
| 202 | |
| 203 | cp legend mapserv scalebar /var/www/cgi-bin |
| 204 | cp mapscript/php3/php_mapscript.so /etc/httpd/php_mods/ |
| 205 | |
| 206 | # add to /etc/httpd/conf/httpd.conf |
| 207 | |
| 208 | # |
| 209 | # For PHP scripts as CGI-BIN |
| 210 | # |
| 211 | AddType application/x-httpd-php-cgi .php .php4 .phtml |
| 212 | Action application/x-httpd-php-cgi /cgi-bin/php |
| 213 | |
| 214 | /etc/rc.d/init.d/httpd restart |
| 215 | |
| 216 | # create /var/www/html/info.php |
| 217 | <?php |
| 218 | dl("php_mapscript.so"); |
| 219 | phpinfo(); |
| 220 | ?> |
| 221 | |
| 222 | # check the output of http://yourhost/info.php |
| 223 | # for mapserver support |