http://www.chrispearson.org/pages/articles/opensource/install/default.aspx
17h15
Friday, 28. August 2008

OPEN SOURCE OPTIONS

 

While looking comparatively at VB and PHP solutions to a business requirement, my research made me realise that many Windows users actively distrust PHP with its Unix geneology. This impression has often lead to avoiding PHP and without familiarity an aura of perceived complexity has begun to surround it.

Quite why anyone should consider PHP somehow more geeky and VB - or C#, indeed - as less geeky I don't know! The presentation of open source and the general regard of Windows from the other side certainly hasn't won the open source movement as many friends in the Windows world as it deserves.

Similarly, why should spending money on Access and SQLServer licences somehow make those database products better than MySQL? MySQL, after all, has got some very serious effort behind proving it as a major player. And there is a good argument that support for MySQL is better than any other DBMS - it's certainly more copious!

But - politics aside - it is very straightforward to install PHP and mySQL on Windows (or, indeed, either of them if you don't want both!) It's much the same on any of the Windows workstation releases from Win95 onwards and servers from NT4.

And - since this combination of PHP and MySQL is used for so many commercial web sites now - these are something with which every developer should be at least familiar.

Both PHP and MySQL arrive regularly on the cover discs of magazines and on the support CDs in the back of how-to computer books. But the best bet is probably to download what you need from the web. Neither of the downloads is huge - certainly nothing that restricts usability to broadband.

Anyway, if you're running a Windows OS with (probably) IIS, why not give these the once over? The notes below cover the very straightforward steps to install PHP and MySQL and get them working. You could have your first database-connected PHP page up inside the hour!

PHP: See www.php.com
MySQL: See www.mysql.com
 
MySQL MySQL: See www.mysql.com
Download  

Go to the MySQL homepage at http://www.mysql.com and click on the Downloads tab

Choose the newest stable release on the list and scroll down to Windows Downloads

Click on the download link - Choose a download location and select either HTTP or FTP

When the download dialog box appears choose the Save option and put the file somewhere sensible, like C:\Downloads\PHP\ The naming convention for the download files is usually mysql-<version number>-win.zip

Unzip the download file (use a zip utility like WinZip or PKZip) to a temporary folder, such as C:\Temp

You are now ready to install MySQL using the setup.exe application

 Install  

Log on to Windows with administrator's rights

Navigate to the temporary files folder (C:\Temp in this example) and double-click on setup.exe

Review the notes and click on Next

Check the licence agreement and click I Agree

Accept the default installation folder or click on Browse to select a folder, then click on Next

Choose Typical install and click on Next

Note that the database server may or may not have been started - It doesn't really matter at this stage since we'll look next at starting and stopping the server: If it is running there will be a green traffic light in your system tray

Starting and stopping the database server  

The MySQL installation includes a management tool, WinMySQLadmin but it doesn't create a separate program group for MySQL applications.

If the server is running then there will probably be an option in your Windows StartUp menu. If not you'll need to find WinMySQLadmin.exe in the mySQL program files folder (C:\Program Files\MySQL\bin\ or wherever you installed MySQL) Once located, create a shortcut on the desktop.

With WinMySQLadmin running, right-click on its window to show its menu

Select your current Windows operating system

Click on Start the Server

Right-click the window again and from the menu choose Hide Me

To stop the server use the Stop the Server menu option

Auto-start the MySQL database server  

 Launch WinMySQLadmin, as described above

Click on the my.ini Setup tab

Click on Create ShortCut on Start Menu at the bottom-left

Exit WinMySQLadmin using right-click and choosing Hide Me

Done!
You now have a functioning MySQL database on your Windows system!
Top of this page
 
PHP  
Download  

Go to http://www.php.com and click on Downloads

Find the Windows Binaries section and click on the latest version (Highest version number with latest revisions) This starts the download process

Click on Save the file and - when the dialog box opens - choose a location in which to save it, such as C:\Downloads\PHP. Click Save

The download filename will have the format PHP<version number>-installer.exe. It doesn't need to be unzipped like the MySQL download

 Install  

If you are running a Microsoft web server (IIS or PWS) leave your web server running and go to the next step because IIS and PWS will configure PHP during the installation - If not, then shut down your web server

Locate the PHP download folder - C:\Downloads\PHP\ in this example - and double-click on the executable

The PHP installer launches. Review the notes and click Next

Read the licence details and click on I Agree

At the installation dialog select Standard and click Next

At the installation folders dialog either accept the default folder or use Browse to choose another folder. Click Next

You can - at this stage - leave the Mail Configuration alone - Just click Next

The next dialog deals with servers: Choose the web server you're running and then click on Next. If the server you are using isn't listed, select None and click Next

The installation start dialog is shown: Click on Next to start the installation

If you are running IIS (or on an older Windows system, maybe, PWS) PHP is configured during installation

Reboot your machine and check that the web server is running

 Done!  

Create a web page using the phpinfo() function, like this,

<html>
< head>
< title>PHP Information</title>
< /head>
<body>
< ?=phpinfo() ?>
< /body>
< /html>

save it to your web and load it into your browser.

Oh, joy!

 
   Top of this page
   

xxx,xxx

copyright ©2000 - 2008 Chris Pearson