LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-26-2009, 12:56 PM   #1
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Huge (Perl) problem: "DBD::mysql" fails on host Apache...


I have a Perl application that (has to...) run as a CGI application on a shared host. I have quite an intractible problem here... please read the following description c-a-r-e-f-u-l-l-y and please help me if you can.
  1. The program uses DBD::mysql, which has been installed into the local shared-host directories and correctly placed into the @INC array via a use lib statement. All parameters are known-good. Based on the output in a log file from the web-app (when run by Apache...) I know that one of the entries in @INC does point to a location where auto/DBD/mysql/mysql.so can be found, and that it does exist.
  2. The program works correctly when run directly from the command-line on the shared host.
  3. When run from Apache on the same host, however, the application's log-file contains the following error:
    Quote:
    DBIx::Class::ResultSet::next(): DBI Connection failed: Undefined subroutine &DBD::mysql::db::_login called at /homepages/blah-blah-blah/local-perl/lib/perl/5.8.8/DBD/mysql.pm line 142.
    (This is the correct file-path. And since the message is in the application's logfile, we also know that the application is running.)
  4. All of the .so files are executable. r-xr-xr-x.
  5. I do not have access to Apache error-log files on this host.
  6. When run on an Apache server on my development machine... it works.
  7. I have systematically determined that the proper copy of mysql.so is being used on my system, by having temporarily renamed all others.

In other words, here we are dealing with some kind of difference between the Apache CGI environment on the shared-host, and both the command-line environment on that host and the Apache CGI environment on my box. This is why I call the problem "intractible," and by now I am quite desperate for a solution.
 
Old 02-28-2009, 08:04 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Thinking of things that can be different between the Apache and Bash environment, I can think of a couple of possibilities. Firstly, when run as a child of the Apache server, the UID will be that of the Apache server. File permissions and the likes of SElinux could be at play here. Also, and I'm not sure how/if this applies to Perl, but if you are using object libraries, there must be a way for a linking loader to locate them, and the value of $LD_LIBRARY_PATH influences that. This could be different within the two environments. I don't think @INC would play a role in locating such libraries, only Perl modules, but you should be able to test this. Another issue may be the use of mod-perl on the server. I know only that there are some subtle differences between plain Perl and mod-perl, and it seems like one possible avenue to explore.
Interesting problem. Hope this helps.
--- rod.
 
Old 02-28-2009, 03:58 PM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
There is no mod_perl as far as I see. Are the mysqld and the webserver running on the same box? Can't you install the DBD::mysql in a global way? Seems @INC contains different elements depending on the user excuting perl.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bugzilla - MySQL - perl - DBD::mysql install problem amchargue Linux - Software 3 09-10-2008 12:01 AM
Bugzilla - MySQL - perl - DBD::mysql install problem Runningonair Linux - Software 8 10-12-2007 12:42 AM
Problem installing Perl DBD::mysql orfiyus Linux - Software 6 03-03-2007 01:52 PM
perl-DBD-MySQL installation problem kartheekpn Linux - Software 3 09-23-2005 03:01 AM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration