On Fri, May 07, 1999 at 10:50:36AM +0700, abu wrote:
> Is The PHP replate PERL because PHP have PERL syntax ?
> How to work together (I mean INSTALL) MYSQL+PHP+PERL of course APACHE !
PHP doesn't replace Perl, although usually you'll use one or the other,
but not both, in a project.
Installing PHP is separate from installing Perl. They don't have anything
to do with each other.
I don't know anything about installing PHP, although I've heard it is
extremely easy to get PHP working with MySQL.
To get Perl working with MySQL, just do this:
1) Install Perl, if you haven't already.
2) Install MySQL.
3) Install the Perl modules listed on http://www.mysql.com/downloads.html
4) Try it out:
#!/usr/bin/perl -w
use strict;
use DBI;
my $dsn = "DBI:mysql:";
my ($user, $pass) = ('', ''); # you may need to fix these
my $dbh = DBI->connect($dsn, $user, $pass)
or die "connect failed: ", $DBI::errstr;
my $sth = $dbh->prepare('SHOW DATABASES')
or die "prepare failed: ", $dbh->errstr;
$sth->execute
or die "execute failed: ", $sth->errstr;
while (my $row = $sth->fetchrow_arrayref) {
print join('', map {"($_)"} @$row), "\n";
}
$sth->finish;
$dbh->disconnect;
exit;
Once you have that working, you can try installing mod_perl
(see perl.apache.org for lots of information on that), if
you want. You don't need mod_perl in order to use MySQL
and Perl for your CGI programs, though.
Tim