Failure to install Apache on Vista

I’m trying to install Apache on my new machine and failing. Whilst installing Apache, PHP and mySQL last time, on Win XP, was no walk in the park I’m sure I never had this issue last time. In any case I’ve no idea where to begin to solve it so I’m throwing it open to you guys.

I’m running Vista Home Premium on an Intel Core 2 Duo machine.
Files I have: apache_2.2.4-win32-x86-no_ssl.msi and php-5.2.2-win32-installer.msi

When attempting an Apache install I get this error:

“Installing the Apache2 service
(OS 5)Access is denied. : Failed to open the WinNT service manager
Note the errors or messages above, and press the key to exit. 20…”

Followed by this (once I press ESC):

“[Sat May 26 02:21:34 2007] [error] (OS 2)The system cannot find the file specifi
ed. : No installed service named “Apache2”.
Note the errors or messages above, and press the key to exit. 21…”

Clearly it hasn’t worked but ever the optimist I tried to install PHP, rationalising that it may just be Vista being a dick and that the install may have worked. Hey, I’ve done it with other programs before, not necessarily on this set up but sometimes it just works. Anyway, the PHP installer tells me it cannot find Apache 2. Fair enough.

this isn’t a php error, this is an apache error. try uninstalling it and reinstalling apache, to see if this fixes the problem. also another common reason what causes this is, trying to install apache into a blank directory. example would be like installing in the C:\ alone vs c:\apache2.2 does this make any sense.

You need to install and run Apache as administrator on Vista.

Ok. I’ve done the following:

First of all, I turned off User Account Control:

  1. Start > Control Panel
  2. User Accounts
  3. Click “Turn User Accounts Control on or off” Link.
  4. Uncheck “Use Uer Account Control” Box
  5. Click OK
  6. Restart Windows

I then ran the installer through the command prompt running in Administrator mode:

  1. Start > All Programs > Accessories
  2. Right-Click “Command Prompt” and choose “Run as Administrator”
  3. Change to your desktop folder (usually cd desktop)
  4. Type the following: “msiexec /i apache.msi”
  5. Run through the Apache installer as normal.

The test page at http://localhost (or http://127.0.0.1/) gives me the “It works!” confirmation.

I then ran the PHP 5.2.2 installer. It installed fine. To add php support to Apache, as per the usual fashion, I followed these steps:

  1. Copied the php5ts.dll file to C:\Windows\System32
  2. Copied the php.ini file to C:\Windows and then added the following to the end of the file:
    a. extension_dir = C:\PHP\
    b. session.save_path = C:\WINDOWS\TEMP
  3. Added the following to the Apache httpd.conf file
    a. ScriptAlias /cgi-bin/ “C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/”
    b. ScriptAlias /php/ “C:/php/”
    c. AddType application/x-httpd-php .php .php3 .phtml
    d. AddType application/x-httpd-php-source .phps
    e. AddType application/x-tar .tgz
    f. Action application/x-httpd-php “/php/php.exe”
  4. NB: I opened and checked the install readme for PHP 5 and altered the text lines as per instructions since some things are different for PHP4 and 5 (e.g there is no longer and “extensions” folder in C:\PHP\ and I tried using C:\PHP\dev as well).
  5. Restarted Apache

Actually the PHP installer altered some of those things but I’ve been running through an Apache/PHP install tutorial (which I did last time I installed this all on XP) and it seems that PHP installs automate a little bit more of the process than they used to.

At first I was getting a “403 Forbidden” error when trying out the phpinfo.php test but adding one of those lines (which I initially missed) seems to have fixed that. Now I just get a blank page, and the old php files I have (from my old sites) that are in the Apache2/htdocs folder don’t run the php either. Seems I now have permission but that php isn’t working.

I’ve run through this twice now, with full uninstall/reinstalls in between. Can anyone see what I’m doing wrong? Apache seems fine now – it’s in the task list and I’ve turned off the Apache Monitor from the startup folder to avoid the error box that otherwise comes up. The Apache confirmation page is still fine – it just seems to be PHP that is now failing me. My phpinfo.php file only contains the following ““<? phpinfo() ?>” as per usual instructions.

I’m having a similar problem. Apache and Active Perl both work but I get a blank page one PHP is installed. I get no responce from PHP at all and my website is down for the count :sick: until it’s fixed.