Commander Salamander has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I've been putting together a small mysql database on a Fedora Core 3 box, and have run into a big snag with my perl cgi scripts. Although the scripts can access mysql fine from the command line, they yield the following error when trying to access the database through a browser:

install_driver(mysql) failed: Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/mysql +/mysql.so' for module DBD::mysql: /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/mysql/ +mysql.so: cannot enable executable stack as shared object requires: Permission d +enied at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230. at (eval 9) line 3 Compilation failed in require at (eval 9) line 3. Perhaps a required shared library or dll isn't installed where expecte +d at /var/www/cgi-bin/dbtest.cgi line 24
I presume that I am encountering some sort of permission problem, but I thought I had the mysql privileges set up properly (I also have disabled SELinux protection for the httpd daemon... to no avail).

Could someone please point me in the right direction in troubleshooting this?

Thanks!

Edited by Arunbear: Changed title from 'PerlMonks to the rescue? Perl DBI problems...', as per Monastery guidelines

Replies are listed 'Best First'.
Re: DBI / MySQL problem when executing CGI script
by wazoox (Prior) on Jul 25, 2005 at 17:17 UTC

    Well, the message is clear:

    cannot enable executable stack as shared object requires:

    So SELinux is probably guilty... Try restarting Apache? Reboot the server? I don't know how this stuff works exactly, but it's obviously a SysAdmin problem, not a perl problem.

      Thanks. I have indeed traced it to a httpd.conf setting. I will take my questions to a more appropriate forum now.
        Well, keep up informed of the solution then, in case it may help someone else someday :)