in reply to Why does the same perl routine behave differently under cgi?

All of the checkpoints by moritz are strategically correct, but here are some tactical things to do to help debugging:

  • I assume that your webserver is properly configured (can you run other scripts?) and that your file/directory permissions are correct.
  • Compare your environments both in the shell (env|sort) and perl (print Dumper(\%ENV);) and compare the results from when you are logged in as yourself versus when the script is called by the webserver.
  • Make sure you can see the webserver access and error logs and know how to interpret messages there (or at least post them to perlmonks next time).
  • Your version of SVN is probably compiled against various shared libraries. These shared libraries may be installed in /usr/local/lib which is in your environmental variable LDPATH or LD_LIBRARY_PATH. However this env variable may be set to something different for the webserver process calling your perl script. I have frequently had problems like the one you are describing, and have discovered that the webserver error logs show that libraries like libapr, libapr_util, libiconv, libneon, etc could not be found when the webserver spawned process tried running SVN. SVN uses a lot of "non-core" (to the OS) libraries.
    • Comment on Re: Why does the same perl routine behave differently under cgi?
  • Replies are listed 'Best First'.
    Re^2: Why does the same perl routine behave differently under cgi?
    by binurajkr (Initiate) on Mar 24, 2009 at 01:00 UTC
      Thanks for all the quick responses. I will try to print the ENV parameters and look into the weblogs