|
Posted by Justin C on June 27, 2007, 11:32 am
Please log in for more thread options >> I have the following code to connect to a database:
>
><snip>
>
>> If I run this from the command line "Connected" gets printed. If I run
>> it from a browser I get:
>>
>> DBI connect('database=prospects','justin',...) failed: FATAL: Ident
>> authentication failed for user "justin" at
>> /var/www/inhouse/prospects/demo.cgi line 22
>>
>> Does anyone know why this should be?
>
> The user you're logged in as on the command line has access to the
> database. The user your webserver is running as does not.
>
> Fix the access permissions to your database.
>
> See also:
> $ perldoc -q 500
> Found in /software/perl-5.8.5-0/pkg/lib/5.8.5/pod/perlfaq9.pod
> My CGI script runs from the command line but not the
> browser. (500 Server Error)
Thank you Paul, adding www-data to the list of database users fixed
this.
Justin.
--
Justin Catterall www.masonsmusic.co.uk
Director T: +44 (0)1424 427562
Masons Music Ltd F: +44 (0)1424 434362
For full company details see our web site
|