[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Using DBI in CGI::Application


Yes this was it. Thank you. I understand these permissions are too liberla in the production environment but I'll let it go for development.

This script worked before I changed the directory permissions (addprof.pl):
No none of these make a difference. I want to reiterate thath this works:
(addprof.pl)
#! /usr/local/bin/Perl -w
use strict;
use DBI;

my $dbh;
my $sth;
my $sql;

$dbh = DBI->connect('dbi:SQLite:/Library/Webserver/CGI-Executables/cgiDev/dbitest/exams.db') or die $DBI::errstr;
$sql = "INSERT INTO profs (profName) VALUES (?)";
$sth = $dbh->prepare($sql);
$sth->execute('Prof BS');
$dbh->disconnect();


but I gest I was just running this from the command line not as a CGI.

Thanks again

>>> Jean-Marc Pennel <suppressed> 5/21/2004 12:38:38 PM >>>
Le 21 mai 04, à 18:21, Geoffrey G. Hankerson a écrit :

> Both
> chmod 666 exams.db
> and
> chmod 777 exams.db
>
> produce Error on insert into profs: unable to open database file at 
> Course_manager.pm line 31
>
> line 31 is $sth->execute() or die "\nError on insert into profs: 
> $DBI::errstr";

Ok, the DB file is here:
/Library/Webserver/CGI-Executables/cgiDev/dbitest/exams.db

You are using MacOS X for training, I suppose.
Therefore, all the directories in the path to DB file must be RWX:
$ chmod 777 /Library/Webserver/CGI-Executables/cgiDev
$ chmod 777 /Library/Webserver/CGI-Executables/cgiDev/dbitest

For production server, use chown www:www and make chmod 700, of course.


JMP
--
http://www.suricate.net 

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/ 
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 
To unsubscribe, e-mail: suppressed 
For additional commands, e-mail: suppressed 



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.