Can't setup mod_perl and DBD::Sybase

From: Miguel Covas O'Ryan (miguel.covas_at_bancoval.es)
Date: 06/14/04


Date: Mon, 14 Jun 2004 22:20:11 +0200
To: dbi-users@perl.org

I've been using DBD::Sybase with CGI scripts. Now I'm trying to migrate
to mod_perl, but it seems
I'm unable to make it work.

I have half a dozen of scripts which use a module that I built with the
most common queries. It works
(And since there is no a heavy duty application I didn't mind
connecting to Sybase each time, etc.).
Now I'm trying to set it up with mod_perl but I always get this error
at the Apache error_log

Open Client Message:
Message number: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (131)
Message String: ct_init(): network packet layer: internal net library
error: Attempt to load protocol driver failed
[Mon Jun 14 21:57:45 2004] [error] 6752: ModPerl::Registry:
install_driver(Sybase) failed: DBD::Sybase initialize: ct_init(12500)
failed at /opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi/DynaLoader.pm
line 225.
Compilation failed in require at (eval 11) line 3.

I wondered if it had to do with the fact that I initialized $SYBASE,
etc in a BEGIN block into the
module (albeit it worked as plain CGI). I moved the BEGIN to the main
script: no way.
I thought that perhaps I needed to set up $SYBASE from Apache, so I
started Apache from an environment
with $SYBASE, $SYBASE_OCS and $LANG .. AND set the proper PerlSetEnv
directives: no way

The fact is that if I call the perl script from a shell script and then
the shell script from Apache it works !?

So I set up a dosomething.sh which contains just:

#!/usr/bin/sh

perl dosomething.pl

and then I call dosomething.sh from Apache as a CGI... very clumsy

Now, I don't know how to fix this.

I'm using HP-UX 11.0, Sybase ASE 12.5 OCS 12.5, DBD::Sybase 1.01 and
HP-UX_Apache-based_Web_Server/2.0.45 (Unix) mod_perl/1.99_08
Perl/v5.6.1 DAV/2 Server at plus.bancoval.es Port 80

Any hint?

Miguel Covas O'Ryan

Director de Sistemas de Información
Bancoval, S.A.
Fernando el Santo, 20
Madrid 28010

AVISO LEGAL
Este mensaje de correo electrónico y sus documentos adjuntos están dirigidos
exclusivamente a los destinatarios especificados. Puede contener información
confidencial o legalmente protegida. No hay renuncia a la confidencialidad o
privilegio por cualquier transmisión errónea. Si usted no es el destinatario
indicado, le rogamos que lo elimine y se lo comunique al remitente. No debe,
directa o indirectamente, usar, revelar, distribuir, imprimir o copiar
ninguna de las partes de este mensaje. Si siendo destinatario de este
mensaje no consintiera el uso de correo electrónico, rogamos nos lo
comunique inmediatamente.
Bancoval,S.A. y sus filiales no serán responsables de las opiniones o
informaciones incluidas en este mensaje salvo cuando el remitente esté
autorizado para establecer que dichas opiniones proceden de Bancoval,S.A
y sus filiales.

DISCLAIMER
Addressee/s identified herein. It may contain confidential or legally
privileged information. No confidentiality privilege is waived or lost
by any mistransmission. If you are not the intended recipient, please
immediately delete it and notify the sender. You must not, directly or
indirectly, disclose, distribute, print, or copy any part of this message.
If you are the addressee of this message and do not consent to the use of
e-mail, please communicate it to us immediately. Bancoval, S.A. and its
subsidiaries are not responsible for the opinions or information included
in this message except when the sender is authorised to state them to be the
views of Bancoval, S.A and its subsidiaries.



Relevant Pages

  • Re: dynamic lib ignored even after "found" in "install_driver(Oracle) failed: Cant load..." cgi prob
    ... the solution i found is this: i moved the directory containing libclntsh.so under /usr/lib, which is a location that apache seems to trust, as opposed to where i had originally placed this directory. ... so, if i knew then what i know now, here are the steps _I_ would use were i to install the oracle instantclient such that the DBD::Oracle module would work when used in an apache 2.0 CGI: ... i also could run it this way by placing tnsnames.ora in my home directory as .tnsnames.ora, but this location will do me no good when i want apache to run the script as a cgi. ... am i missing some sort of configuration detail regarding apache and permissions granted a cgi? ...
    (perl.dbi.users)
  • Re: Apache Security Issue: File Access
    ... > I just recognized that with Apache configured for VirtualHosts, ... > - no one can ready files using a file system call in CGI or ASP ... Does the target program name have a / or .. ... Does the user who owns the target script exist on the system? ...
    (comp.security.unix)
  • Re: Rivet and snit....
    ... You will need to set up Apache to make sure your directories are ready ... to execute CGI (if you plan to say turn your welcome page into a CGI ... script to generate the page). ... indicate it's intent - then process it as a form submission script. ...
    (comp.lang.tcl)
  • Re: Key-passing from PHP to TCL CGI script - how is it done (web security issue)?
    ... TCL v.8.3 ... set hasEnteredTrivia 0 ... # NEW 8/7/2004 USE PHP (AS CGI) TO CHECK IF USER IS ATTEMPTING TO ENTER ... # USE REMOTE PHP SCRIPT TO CHECK FOR REPOSTING ...
    (comp.lang.tcl)
  • Re: PHP and MySQL passwords
    ... I'll assume your on a linux system with apache as your webserver. ... If it is shared is PHP running as a module or cgi? ... If you code the user/pass in a file anyone with an account on the ... file either by reading it directly or by writing a script to read it. ...
    (alt.php)