logo

Lighting the LAMP with Linux

As an all-round web enthusiast I am slightly ashamed to admit that it was only today that I learnt what the LAMP in onlamp.com signified. I knew ON was the O'Reilly Network but had never bothered to notice that LAMP stood for Linux Apache MySQL PHP/Perl/Python - The Open Source Web Platform. Shame on me!

Anyway, they've got an article published this week about Linux Annoyances. In it they talk about "RPM hell", something I've been introduced to recently. Funnily enough it was while getting my very own LAMP box setup. Unbeknown to me was that if you choose to install MySQL and PHP as part of a Red Hat setup it doesn't automatically intall support to link the two. Stange but true. My first attempt to connect PHP code to the MySQL database engien resulted in the following nastiness:

Fatal error: Call to undefined function: mysql_connect()

A little searching round and I found the answer. I needed to install the PHP-MySQL libraries from the relevant RPM. First thing I tried was to use the Red Hat Package Management GUI but this failed with no errors when I tried to add the extra package. Next step was to attempt it from the shell using the rpm command. What it told me was that I had the wrong versions and that the dependencies were all wrong. The reason for this was that, since downloading Red Hat, I had run the equivalent of Windows Update and I now had a more recent version of PHP. I was trying to install php-mysql-4.4.2-17 with php-4.4.2-17.2. Silly old me!

The solution was to search the Red Hat RPM site for the correct update. This installed fine and now everything works. You might say, the LAMP is well and truly lit. Here's a little tip I picked up along the way. Type rpm -qa | grep php at the command line and you see a list of all packages installed with php in their name. Useful in figuring out whether an install was succcessful or not...

Comments

  1. In a case like that you're better off doing a `grep -i php' which ignores case.

  2. In case you do not want to subscribe to RedHat Network, you may find this interesting: {Link}

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Sun 14 Sep 2003

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content