sanjay nayak has asked for the wisdom of the Perl Monks concerning the following question:


Hi Monks

i have installed Mysql-4.0.13-win and Active perl-5.8. I want to use CGI script. How i can write a simple CGI script. whether it will be saved as .cgi extension or not? Where that CGI script will be saved. How to run or access that CGI file in browser?

can anyone suggest me?

Regd's
Sanjay
  • Comment on How to use perl CGI programs with mysql server?

Replies are listed 'Best First'.
Re: How to use perl CGI programs with mysql server?
by marto (Cardinal) on Oct 29, 2008 at 09:53 UTC

      In addition to what marto has already suggested.

      You may find that you can get most of what you need from FirePages MySQL Apache server integration that works with Perl.


      Hi Marto

      Many many thanks for your reply. Can i use Mysql server instead of Apache server? If yes then how? Because my requirement is to use the Mysql server with the CGI script. plz suggest.

      regd's
      Sanjay

        MySQL is a database product, not a webserver. If you want a webpage to interact with a database at some point you are going to need Webserver software, like Apache.

        So, to answer your question, no, you will need MySQL server to run your database, and Apache to serve your webpages (generated via your CGI connected to MySQL).

        Hope this helps

        Martin

        Not sure what platform you are on, but it looks like you are just starting out so I suggest a simple package like XAMPP (apachefriends). Its insecure, but is easy to setup and run to get started and play. It includes Apache, mysql and Perl (and some other language called PHP). There are other similar packages about.
Re: How to use perl CGI programs with mysql server?
by lamp (Chaplain) on Oct 29, 2008 at 09:48 UTC
Re: How to use perl CGI programs with mysql server?
by TGI (Parson) on Oct 29, 2008 at 17:35 UTC

    You may wish to install a perl/apache/MySQL bundle rather than integrate all the pieces yourself.

    If so check out XAMPP from Apache Friends. They provide apache, mysql, php, perl bundled into a single installer.

    Another option is Indigo Perl. IndigoStar bundles perl and apache in one installer. You'll need to manage your own MySQL installation and configuration.

    Please don't think that I am against using ActivePerl--I use it every day. I suggest these other options because they provide you with preconfigured software that may make it easier for you to get started.

    If you are going to be serving pages that are open to the Internet or otherwise liable to be hacked, be very careful relying on preconfigured servers. If this is the case, I suggest that you start learning on a test box and find a reliable hosting provider. Once you have learned about security and ins and outs of apache/mysql/perl, then you should consider hosting your own internet webserver.

    On the other hand, if you are working in a sheltered environment, a preconfigured server is a great way to get started. You will get a basic system up and running very quickly, and have nearly immediate payoff for your work.

    In any case, read lots of tutorials, read the manuals, experiment and ask questions. Good luck in your new endeavor.


    TGI says moo