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

Hi, I created a CGI perl script that will be placed on a school server. I have secured from the school a MySQL account for a DB backend for my script and a unix account on a Sun box (Solaris 9, I believe). I made this program on my own Linux box and now I would like to migrate it to the Sun CGI server. After doing a "perl -MCPAN -e shell" plus "install DBI" on the Sun box, perl initialized and downloaded the appropriate packages. However, this Sun box does not have the "make" command on it. Therefore, when perl tries to compile the DBI package, it fails (I didn't even know that DBI needed to be compiled). Within my project directory, I also have a modules directory (which I "included" in each of my program files). This allows me to include all sorts of extra perl modules without installing them through CPAN; I can just copy them over from one server to another. Originally, I had copied the DBI module into that included directory. However, if that module is, indeed, a compiled module (as it seems like it might be), it won't run on the Sun box either. Mainly, I am looking for the easiest solution that would allow me to access a MySQL style database. One person once told me about DBI::MySQLlite (or something like that). This might be an option, but I am not sure if it needs to be compiled as well. Does anyone have any information on this module? Also, I don't want to give up on the actual MySQL database and the DBI module. Does anyone know how I might compile the DBI module (without the "make" command) so it will work on the Sun or does anyone have any other ideas? I would prefer not to have to change all of my database function calls. This type of situation has always been one of my greatest fears when designing this project and now it is comming true ;-) Thank you for looking at my problem. Have a nice week, Joe

Replies are listed 'Best First'.
Re: DBI Install Problem
by mpeppler (Vicar) on Dec 09, 2004 at 07:10 UTC
    "make" on Solaris lives in /usr/ccs/bin.

    However, as BUU pointed out you'll also need a C compiler. gcc can be downloaded from http://www.sunfreeware.com, along with a bunch of other tools. Obviously you'll need root access to be able to install them.

    Michael

      Hi, Given your point of information, I checked for the compiler in /usr/ccs/bin and didn't find it there. The box was likely set up with a minimal install. Thanks for your lead to sunfreeware. I don't think the sysadmin will go for installing gcc on that machine though. I really appreicate your help. Thanks for your time. Joe
Re: DBI Install Problem
by Luca Benini (Scribe) on Dec 09, 2004 at 07:15 UTC
    You can find tons of binaries for solaries 9 here the site is sponzorized by sun. This is a way
    Another way: Download sources of gcc , make etc...

    Attenzion. don't use compiler versione lower than default solaris 9 compiler


    bye
      Thanks for the reference. I'll have to look into finding a Sun compiler somewhere... I appreciate your post. Joe
Re: DBI Install Problem
by BUU (Prior) on Dec 09, 2004 at 06:59 UTC
    Install "make" and "gcc" (or the sun equivalents) on the server and install as normal. Really, it's the best way.
      I don't think I will be albe to get root on this machine. Perhaps I can find a Sun box somewhere else to compile on and copy the files, but ever since our school moved most of its UNIX boxes from Solairs to OS X, Sun boxes on our campus are few and far between. Thanks for your interest in my problem and for your reccomendation. I'll see what I can work out. Joe
Re: DBI Install Problem
by dragonchild (Archbishop) on Dec 09, 2004 at 13:54 UTC
    Every database module (outside of some toy ones) will need to be compiled. So, you're pretty much going to have to get a compiler.

    Now, have you thought about asking the sysadmin to install DBI for you? Sounds like the easiest route ...

    If you absolutely must do it yourself, go to the GNU site and look for their bootstrapping gcc installation. It includes binaries for most major systems of things like make, bison, yacc, etc. When you're done, you'll have an installation of gcc. Now, you'll have to make sure you PREFIX it with your home directory on the Solaris box.

    My last suggestion is very much the guerilla way and is recommended only for people who know what they're doing. The better solution is talking to the admin.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      Hi, It's useful, yet dissappointing, to know that the other database modules (such as SQLite) won't be fruitful as well since they all need to be compiled. I'll have to look into both of your options. Since the accounts are a type of "favor" in the first place, I'm causcious about how much I impose on the sysadmin. However, as you mention, it is probably the best option. Thank you very much for your information. One other thing, if I were to find another working Solaris box that did have gcc on it, would I be able to download and compile the module on that machine ( in let's say the /export/home/jdoe/.cpan/CPAN) and then copy the built module directory to the server (to somewhere like /export/home/joejaz/public_html/cgi-bin/project/lib/CPAN/, which would be a path that is included in each of my program files), or do you know if the path is statically built into the DBI binary (which would cause it to fail if I tried to move it to a different path)? Will CPAN allow me to do this? Thanks again for your post and for considering my problem. Joe