Invalid command ‘PerlHandler’ – PerlHandler ModPerl::Registry

Apache complains on the restart:
/etc/init.d/apache2 restart
Forcing reload of web server (apache2)…Syntax error on line 48 of /etc/apache2/sites-enabled/000-default:
Invalid command ‘PerlHandler’, perhaps misspelled or defined by a module not included in the server configuration
failed!
Have a look what perlhandler it is in apache config file. In this case apache was missing : ModPerl::Registry .
Solution to this is to [...]

Debian apache problem – [error] Can’t locate Apache/DBI.pm in @INC

Debian Apache will not start and it complains in log file:
[error] Can’t load Perl module Apache::DBI for server exiting…
This is because it can not find perl module which apache will use to connect DBI database. Solution for this is to install package:
libapache-dbi-perl – Connect apache server to database via perl’s DBI
apt-get install libapache-dbi-perl

CREATE, INSERT, SELECT, UPDATE Perl script and PostgreSQL database examples

Simple perl to postgresql examples:
#!/usr/bin/perl
#load perl postgresql module
use DBI;
$postgresql_database=yourpostgresdatabase;
$postgresql_user=yourpostgresuser;
$postgresql_password=yourpostgrespass;
$postgresql_host=localhost;
# connect to perl to postgresql database
my $dbh = DBI->connect(”DBI:Pg:dbname=$postgresql_database;
host=$postgresql_host”, “$postgresql_user”, “$postgresql_password”);
# EXAMPLE PERL and POSTGRESQL
# CREATE TABLE EXAMPLE
$sth = $dbh->prepare(”CREATE TABLE perl_postgres
( language varchar(40), version integer);”);
$sth->execute();
# EXAMPLE PERL and POSTGRESQL
# INSERT DATA INTO TABLE
$dbh->do(”INSERT INTO perl_postgres(language, version)
VALUES (?, ?)”, undef, (’perl’, 5)) or die (”Cannot INSERT”);
# [...]