It wasn't me. You can't prove anything.


2003-12-14

Geek Speak
So, I'm trying to get Perl and PHP to work on my Linux box. I have some experimentation to do for Tpro. In Red Hat 9.2, the last free version of Red Hat, I decide to cheat and just install them off the distribution CD. I find out they are already there. In order to make sure they are actually working before I try to install the real software I'm testing, I, being a geek, decide to get the tried and true “hello world” to pop on each first. Now, I might be done installing the test software by now if I had just assumed they work and sallied forth. No. I start pummeling through the documentation for Perl and PHP. I decide Pearl will be first. I tear the machine apart looking for the Perl folder. Other scripting languages like SH (Shell) BASH (Born Again Shell (no kidding)) all have folders to start with. Well, Perl is an executable. it takes me an hour of searching and research online to figure out that I'm barking up the wrong tree. There is Perl, /usr/bin/perl right where it is supposed to be, except it is a binary (and exe in Windows speak) instead of a folder. I write the hello world and it works in one shot.

#!/usr/bin/perl (This like tells the interface where to find the language so it can run the script.)
print “hello world”;

That's it. Three hours later for that. That did include install time.
Now I'm off to PHP. PHP is a bit different. It is a web scripting language only. In other words, you need a web server to run it for you. (PHP does have a command line interface. That is not what I was testing.) I thumb through a PHP book I bought several months ago. The first chapter has the fabled “hello world” page ready for my use.

<html>
<head>
<title>Lookout World!</title>
</head>
<body>
<?php echo 'hello world' ?>
</body>
</html>

I pop over to my HTTP folder and plop the script down in a test folder and try to hit it from outside. “object not found”. =\ What the heck? I stare at the PHP script on the screen and think to myself “It is right here in the screen. What do you mean you can't find it?” Well, it isn't the computer, it is me. I've put the script in the wrong test folder. I pop over to the right test folder and retype the script, because I can't remember the intricacies of the mv command in Linux, and Putty (the term program I'm using) locks up. I must have it some magic key to upset Putty. “rassa-frassin-picajunk”. Then came the magic words in my browser “Hello World”. They some how make everything OK.