| 1 | = Perl Mapscript 3.5+ Debugging = |
| 2 | |
| 3 | == Submitted by Aaron D. Hunt <hunt@zedxinc.com> == |
| 4 | {{{ |
| 5 | $ENV{MS_ERRORFILE} = "/var/log/mapserver.log"; # map engine error log |
| 6 | }}} |
| 7 | near the top of the perl mapscript code... before |
| 8 | you initialize your map object. |
| 9 | This is an environment variable: MS_ERRORFILE |
| 10 | for the shell, or execution instance which catches |
| 11 | all of the errors/warning that occur within mapserver |
| 12 | and sends them to the filespec defined. This one is |
| 13 | the *most* useful log for debugging mapfile errors, |
| 14 | index problems, and mapserver internals, etc. |
| 15 | {{{ |
| 16 | WEB |
| 17 | log "/var/log/mapserver_access.log |
| 18 | END |
| 19 | }}} |
| 20 | in the mapfile. you could probably setup that variable in |
| 21 | mapscript as well, but I have always put it in the mapfile. |
| 22 | It records a set of variables similar to the |
| 23 | apache access log for each mapserver execution. |
| 24 | |
| 25 | == Submitted by Lowell.Filak <lfilak@medinaco.org> == |
| 26 | {{{ |
| 27 | #!/usr/bin/perl -w |
| 28 | |
| 29 | -w posts all Perl warnings to the httpd log file, |
| 30 | usually named error_log in /var/log/httpd or /etc/httpd/logs. |
| 31 | }}} |
| 32 | == Submitted, in part, by Frank Warmerdam <warmerdam@pobox.com> == |
| 33 | {{{ |
| 34 | /sbin/ldconfig -v |
| 35 | }}} |
| 36 | will give information concerning the shared libraries present |
| 37 | on your system. |
| 38 | {{{ |
| 39 | echo $LD_LIBRARY_PATH |
| 40 | }}} |
| 41 | Will give information on the library path traversed when |
| 42 | linking. |
| 43 | {{{ |
| 44 | locate <library_name_ie._gd.h> |
| 45 | }}} |
| 46 | Will give location(s) of the specified filename. |
| 47 | |
| 48 | Does the above information show a mixture of include files |
| 49 | (different revisions of the same library). |
| 50 | |
| 51 | == Submitted by Daniel Morissette <dmorissette@mapgears.com> == |
| 52 | {{{ |
| 53 | ldd mapserv |
| 54 | }}} |
| 55 | Look for the path that is listed. |
| 56 | Then make sure this path is part of your runtime library path, |
| 57 | for this you have two options, assuming you're running Linux: |
| 58 | |
| 59 | 1- add the path to /etc/ld.so.conf and run 'ldconfig' as root |
| 60 | |
| 61 | or |
| 62 | |
| 63 | 2- Use SetEnv LD_LIBRARY_PATH to specify this path in your |
| 64 | apache httpd.conf |
| 65 | |
| 66 | If when running ./mapserv you receive the error message: |
| 67 | {{{ |
| 68 | mapserv:error while loading libraries:libproj.so.0 cannot open shared object file : No such file or directory. |
| 69 | }}} |
| 70 | Run '/sbin/ldconfig -v | grep libproj'. |
| 71 | |
| 72 | Which should return something similar to "libproj.so.0" |
| 73 | If not try reinstalling proj.4 |
| 74 | |
| 75 | == Submitted by Daniel Morissette <dmorissette@mapgears.com> == |
| 76 | |
| 77 | If when running ./mapserv you recieve the error message: |
| 78 | {{{ |
| 79 | error while loading shared libraries :/usr/libwwwappp.so.0 undefined symbol: HTZlib_inflate |
| 80 | }}} |
| 81 | Check /usr/lib and /usr/local/lib for a copy of w3c-libwww. |
| 82 | If both have a copy then remove the copy in /usr/lib. |
| 83 | The cleanest way to remove, is to 'rpm -q -a | grep w3c-libwww' & do 'rpm -e w3c-libwww-<version_number>'. |
| 84 | |
| 85 | If you end up with a "core" file from an error and have the GNU debugger installed: |
| 86 | {{{ |
| 87 | gdb |
| 88 | target core ./core |
| 89 | backtrace |
| 90 | }}} |