Apache on Win 7

First, WELCOME Mark!


I’ve finally updated my computer (a Win7 Home upgraded to Pro) but, while I’ve installed Apache, it’s NOT running properly as it had on my older XP box, presumably because of the Win7 security. This is a TEST server used prior to uploading to the production server.

In “Program Files (x86):”
Apache 2.2 on port 80
PHP 5.2

ALL files specified on a “W:” (web) drive partition

All VirtualHosts listed ( {each VirtualHost})

The Apache monitor shows that no Apache services are running.

If you can see or know of anything about Win 7 which would keep Apache from running, I’d certainly appreciate knowing about it as well as what to try to resolve this problem. (Obviously, IIS is NOT an option as that’s NOT what the production server is using.)





Moving Apache OUT of Program Files did the trick! MySQL IS in Program Files and PHP didn’t want to be in there in the first place so it’s escaped, too.

Because the hosts file is still within the Windows directory, I have to run my text editor as administrator but I can live with that annoyance - httpd-vhosts.conf is outside Program Files so it’s easy to edit for additional test domains - a STOP then START via the Apache Monitor is all that’s required to update the server with a new test domain.




Yeah, but my philosophy is that canned programs are BAD. They are tailored to what the creator wants to do with them, updated only when the creator is in the mood and are NEVER the versions you want to duplicate.

Thanks, though, for the suggestion.



If you haven’t you might take a look at xampp. It makes installing a fully functional WAMP server pretty simple.

Hi and thanks for the welcome.

I actually haven’t tried running Apache on Win7. While I used to be an Apache guy since IIS7 I actually came back to running IIS as my main web server and haven’t had a chance to play with it. That said I might have some help for you here regarding Win 7.

First, I would probably avoid running Apache, PHP and MySQL out of Program Files. Actually I do run MySQL out of that directory but I definitely don’t install PHP there. Permissions and access issues are likely going to bite you there.

If Apache isn’t running then this is a services account issue. I would check to see if it is set up to run as “local system”, should be checked in log in tab in the Windows services module. The service should also be set to start automatically.

The other thing I would do is go to your event log in Windows and check in there to see if something is happening. there may be an error that is occurring that is blocking the apache server from starting.

Hope that is helpful. Let me know if it isn’t. I’ll check back in later to this thread and attempt to install Apache myself on my Win7 box. Should be fun :slight_smile:

I wouldn’t recommend running apache out of Program files, because Win7 has some restrictions on how and if a program can write there. That could be causing your issue, but for now let’s assume that it isn’t.

Try starting apache using the command line and see what errors - if any - it gives you.

Since you are running Windows 7 64bit, you should consider installing Apache 64bit. The are some distributions in the wild - http://www.blackdot.be/?inc=apache/binaries

dk, C:\windows\wamp is where mine is installed (I may have changed the install location when given the option to, can’t remember if I did. With my comp being Win7 64 bit I have “Program Files” which I assume windows treats anything in there as 32 bit only and “Program Files (x86)” I assume Windows thinks of anything in there as 64bit. As I’ve got the space I’ve been installing games to a seperate partition with no problems with them.

If I was doing testing of a site before uploading it do a server then I would most likely uninstall WAMP and install each (Apache, MySQL and PHP) seperate though I would possibly get a real cheap, cheap old 2nd hand computer to install Apache, MySQL and PHP onto separately along with Linux.

Hi Mark!

I’ve taken the advice of the others (and which you’ve repeated) and UNINSTALLED both Apache and PHP then reinstalled on the drive (partition) with the VirtualHost (web) files (NOT in the Program Files directory). Apache worked just fine over there with PHP (NOT MySQL because I’d forgotten to pick and choose among the PHP extensions - it seems that PHP doesn’t like some of the offered extensions but I’m up and running now although I’m still in the process of adding MySQL databases because there is no easy way to transfer the ENTIRE MySQL package from one computer to another).

I should note for others that an earlier problem with Apache was that it didn’t like to have VirtualHosts defined which were not present (archived - not current) so the httpd-vhosts.conf is touchy, too, not just the php.ini!

THANK YOU, EVERYONE, for giving me the direction on this!



If you setup Apache on Linux the same way you do on Windows. Everything thrown into a single folder and single place, it will also be a MAJOR PITA with security. Unless it is outside of a system location (Program Files).

You’ll notice on Linux the temporary runtime files are not created in Apache’s directory like they are in the default setup on Windows. You should also notice when editing Apache’s config file it requires administrative power.

This is the problem most applications are facing on this new model that was started in Windows Vista. This same model is in use by Linux, for example. However, the applications have yet to evolve instead call this model broken.

If you configure Apache to write its runtime files else where, like a temporary directory with the correct permissions you won’t have a problem running Apache under your user account. Or under a different user as it is usually done on Linux.

If it’s the UAC you’re referring to, you can easily turn that off while you set things up. You don’t even have to restart any more. You can do that from your users page in the control panel.
I personally prefer to run my server (in fact, most of my programs) from a secondary drive so I don’t have much setup to do if/when windows needs to be reinstalled.


Thanks! I’m finding that out (Win7’s security is proving to be a MAJOR PITA)!

I’ll give that a try.




Thanks for that input but “in the wild” meaning (third party software) raises a red flag for me! I’ll wait for Apache.org to bring that out under their (trusted) banner.




Does it install to a Program Files directory or its own? I’ll bet the latter as that’s what I’ve found with the REAL programs.[indent]XAMP and WAMP are fine for “snapshots” of web servers (the ones their creators have deemed appropriate) but NOT for duplicating production servers).[/indent]


I can’t speak for how well XAMP does but WAMP runs fine on Windows 7 (64 bit) my guess is that it would also run fine on Windows 7 (32 bit).

xampp isn’t a “canned program” per se. It’s provided by some Apache folks, and it’s just a zip that contains pre-configured (for windows) apache, mysql, php and perl packages. You still have full access to all the .ini files to configure things the way you want, and you get a few batch files that let you control the services, etc., and it’s much easier to install.

I haven’t ever used it on W7, but I’ve installed it on vista and xp a few times, the install is basically that you unzip the download and fire off a batch file to start the LAMP programs.

Since I brought this up I think I’ll go see how it installs on my W7 computer :slight_smile:

It’s the other way round.
Programs Files vs Program files (x86)

About to setup my new pc with apache, mysql and php on win 7 64. Does anyone know of a tutorial for this?