PHP Windows installer gets major overhaul

For years, one of the big complaints from newcomers to PHP has been the lack of a decent way of automating the installation of PHP on Windows. The Windows installer on the official PHP site was totally inadequate to meet the needs of non-experts. It installed a severely restricted CGI version of PHP that included no extensions and required IIS. The lack of extensions meant that support for MySQL was no longer automatically built into PHP 5, and the requirement for IIS excluded anyone using XP Home. All that has changed with the release of PHP 5.2.0. The Windows installer now offers the full range of extensions and automates most of the configuration on a wide range of web servers.

I suppose you could argue that, if you plan to use a programming language like PHP, you should be capable of digging around in a few configuration files and setting everything up manually. That’s true, but it’s been a case of chicken and egg for many people. If you’re completely new to programming, it’s very off-putting to have to struggle for days trying to get everything installed and working correctly. The configuration instructions in the PHP documentation do contain all the necessary information, but they’re very intimidating for a beginner. In fact, it was because I found so many readers stumbling at the first hurdle that I devoted so much space to detailed step-by-step instructions in all my PHP-related books. Yes, I could have told people to use XAMMP or one of the other all-in-one packages, but I have always preferred to stick with the official version. Too many people were left in the lurch when a very popular package stopped development overnight several years ago.

First impressions of the new Windows installer are very favourable. The interface is very familiar to Windows users and the steps are easy to follow. However, in order to make the necessary choices, you need to have a basic idea of the various features offered by PHP. You also need to install a web server first. Otherwise, the installer can’t do the necessary configuration, thereby removing one of its main advantages in the first place. I tested the installer by completely removing all traces of PHP from my computer, and it performed a successful install on top of Apache 2.2.3 with the minimum of fuss. You can see full instructions, complete with screenshots in the Tutorials section of my site.

I would be interested to hear the experiences of others, particular anyone trying it out with IIS.

This entry was posted in PHP. Bookmark the permalink.

11 Responses to PHP Windows installer gets major overhaul

  1. Zach says:

    It seems that if you have IIS installed on your machine it picks it up and runs with it – regardlesss of what you choose for a server… and if you are like myself – that means the installer dies cause IIS just exists but has never been used.

  2. David says:

    I decided to test IIS a week or so after writing my original comments. Selecting IIS 4+ ISAPI module fails, but it works if you use IIS 4+ CGI. I updated the tutorial to reflect those findings. I’m surprised it didn’t work that way for you.

  3. Sheri says:

    Hi,

    I tried to configure apache to work with php like the book indicated, however one line keeps causing it not to work. The LoadModule php5_module c:/php/php5apache2_2.dll. If it’s in the file, apache won’t start, if it’s not in the file apache will start. How do you fix this?

  4. David says:

    If you’re using the Windows Installer, you don’t need to add that line to httpd.conf. The Windows Installer does if for you automatically.

  5. Sean says:

    Hi David,

    I am having a little bit of trouble with the final step of your instructions in Blog Design Solutions. I have checked my script, but cannot get the PHP to load in my browser. Instead, when I choose http://localhost/, I get Index of / index.php.txt.

    To confirm: I set up an htdocs folder in the C drive as recommended and followed the installation instructions from your site for Apache 2.2 and PHP 5.2.X. When I tested the Apache installation it said: “It Works!”

    I have also re-named the temp files C:/WINDOWS/Temp.

    Too much information? Probably, but I would really appreciate the help.

  6. David says:

    See page 23 (Getting Windows to display filename extensions). Save the test file as index.php, not as a .txt file (select “All Files” in “Save as type” when saving in Notepad).

  7. Sean says:

    Thanks David.

  8. Caucus says:

    Hello David

    I love all your books. As sheri mentioned in #3 the setup in the book “Foundation PHP For Dreamweaver 8″ page 67 LoadModule php5_module c:/php5/php5apache2.dll

    When I do this Apache will not start. My guess is maybe that php did not start. How come I cannot get php to start?

    Do you want us to use the new version. I like your idea of making it do what we want.

    What did I miss?

  9. Caucus says:

    Hello

    OK, I tried the new install changed to the correct .dll and then tried everything you have in both books I have both php books.

    I have Apache running in the http://localhost. I could not get anything else to work

    PHP is a no go. Now you know why one uses a program that works. I am not saying you are right in your choice. But for two days I have tried this and nothing this is depressing.

  10. David says:

    Hi Caucus,

    One of the first things you should do when reading a book about computing is to read the book’s updates and corrections page. A book represents a fixed moment in time. Sometimes there are mistakes or misprints. Often, there are new developments with the software.

    Both Apache and PHP are “a program that works”. If you look at the updates pages on the friends of ED site, you will find up-to-date information. You’ll also find detailed instructions in the Tutorials section of this site for using the new Windows installer for PHP.

    If you want help, you also need to be more precise in your description of what happens. Saying that “PHP is a no go” tells me nothing, apart from the fact that it doesn’t work. You need to describe what happens. You also need to say which versions you’re using, and which operating system. Vista is different from XP.

    It’s also better to post requests for help in a public forum, such as the one at friends of ED, rather than in an author’s blog. I’m up to my eyeballs in writing a book about Dreamweaver CS3, so don’t get much chance to devote to troubleshooting installation problems. In a public forum, there’s the likelihood that someone else might be able to come to your assistance more quickly.

  11. Caucus says:

    Hello Great One

    Looking forward to the new Book

    Sorry about the post It will not happen again. I like your books. Just anxious to get php running. I know php and apache work it just is not working on my machine.

    I will get it working shortly.