There are several builds of Apache2 for Windows.
We support ApacheLounge, but other options include XAMPP, WampServer and BitNami, which provide automatic installer tools.
You may use mod_php or mod_fastcgi to load PHP on Apache.
If you use mod_php, you MUST use a TS build of Apache built with same version of Visual C and same CPU (x86 or x64).
How to manually configure Apache2

Choose Build

Download PHP production releases from » http://windows.php.net/download/.
A lot of testing and optimization is already done on the snapshot and qa releases, but you are welcome to help us do more.
There are 4 types of PHP builds:

Thread-Safe(TS) - use for single process web serves, like Apache with mod_php

Non-Thread-Safe(NTS) - use for IIS and other FastCGI web servers (Apache with mod_fastcgi) and recommended for command-line scripts

x86 - production use of PHP 5.5 or 5.6 or 7.0.

x64 - production use of PHP 7.0+ unless its a 32-bit only version of Windows. 5.5 and 5.6 x64 are expiremental.

User Contributed Notes 26 notes

May seem silly, but to follow up on Aditya's helpful tip make sure to download Visual C++ that corresponds to the version of PHP you installed or else you will have failure. http://www.microsoft.com/en-us/download/details.aspx?id=30679. The link he posted took me to a 64-bit version of the install ( I assume it was 64 bit because my OS is 64 bit).

First i need to use full tag to make it your php script works and second the IIS didn't want to load the extension in the ext folder. I cheked the configuration a couple of thousand of time and everything seen to be ok.

I fixed up given read access in the "ext" folder to de "IUSER/PCNAME" user or to everyone/PCNAME user to the same folder. Just in case i did the same in the rest of the folder inside the php folder.

In the Note Titled "Windows Server 2003 (x64 bits) + IIS 6.0" in step 1 when adding your new .php extension, it will not work unless after you click on the "Home Directory" you make sure that your "Execute permissions:" are set to "Scripts Only".

By default, on my machine, the permissions were set to "None" not allowing php to run.

Also, for more security it might be wise to Add the new extension just to your default site instead of the whole Web Sites folder in IIS. This would only apply if you were hosting multiple sites and had a site you didn't want scripts to run on.

I got the 'Fatal Error: call to unindentified function mysql_connect()' and resolved it after many hours of troubleshooting. The problem has to do with the libmysql.dll file residing in multiple directories. It SHOULD only be in the php directory. So, erase the copy in mysql bin and the apache bin and restart apache. I hope this helps someone. if this doesn't help check out forums.mysql.com and search "Call to undefined function mysql_connect". (i got the solution to this problem from here)

Your PHP.INI file is not required to be in the C:\WINDOWS folder in XP. The trick is to make sure that the PHP.INI can be found. If you fail to reboot after adding the PHP folder to the path and creating the PHPRC environment variable, the file will likely not be found. If you can't reboot, then try creating the registry entries as described in the following document:

When you execute "phpinfo();" pay special attention to the data returned in "Loaded Configuration File". If it does not show a path and a the PHP.INI file name, the file is not being loaded. The path of C:\WINDOWS in the Configuration File Path section is the default location where PHP looks for the INI file and does not mean that the file must be located there; in fact, the following document suggest that you leave the configuration file in the C:\PHP folder:

- The browser can't find your php code like localhost/dir/dir_code.php from any virtual directory (404 error)- You are sure the code existsYou may rename it with a .html extension and check if it displays- Process of your php code like localhost/root_code.php is ok from the root directory

It may come from the doc_root directive in php.ini whitch should be set to blank :

If you are running websites within an Application Pool (which is now the default for IIS6 under 2K3) you need to make sure that your PHP directory (e.g. C:\PHP) has read permissions for the user assigned to the Application Pool.

1. In the IIS snap-in, choose Application Pools2. Right-click on DefaultAppPool (or other, if you have one defined) and choose Properties3. Click the Identity tab4. Make a note of the user name set as the security account for this application pool (e.g. "Network Service")5. Browse to your PHP directory and grant that user read permissions for the entire directory.

In my case, I had to add permissions for the user "NETWORK SERVICE" to get PHP scripts to work. Otherwise I received 401/403 authorization errors when trying to load them in a remote browser.

Note also that first tried adding IUSR permissions to the PHP directory, but that had no effect.

In the above, "the web server's directory" means the directory where the server executable lives, for example for the Apache installation on my XP box this is "\program files\apache group\apache2\bin" and NOT just "\program files\apache group\apache2".

But it's probably best to tell your web server where PHP's ini file is stored, for example via PHPIniDir for Apache's http.conf.

You are correct. I just had the same issue; I was following the PHP installation instructions and some very helpful WIMP instructions.

I was trying to keep things tidy by putting my PHP directory in C:\Program Files\PHP. I set the PATH variable, ISAPI filter config and extension in Application Configuration, but was getting the "Specified module could not be found" error.

Changed the PHP directory to C:\PHP and reconfigured everything, did an iisreset, and it started working immediately.

Okay, I'm a total newbie to this, so my findings may be wrong, but this is what I found out.

The manual says "do not have spaces in the path (like C:\Program Files\PHP) as some web servers will crash if you do". Indeed, when using this with PHP5 on WinXP, I got the error message "The specified module could not be found."However, the problem seems not to lie in the SPACE in the pathname, but in the QUOTES that Windows adds when a space is in the pathname! This is what I found:

After having the same problem as specifed below with "No input file specified". I changed the doc_root as mentioned.

This is fine if all php scripts are going to be run from the c:\inetpub\wwwroot directory. To enable it for multiple websites where the root directories are all different simply leave the doc_root attribute in the php.ini file blank.

This is for the isapi version not cgi implementation. It also means you don't have to set IUSR or IWAM access to the PHP root directory.

You are absolutly correct. I found this out while trying to install PHP4 with Apache2 on XPPro. Here are 3 general guidelines that I have found to be correct:

- Path may not have spaces. Change C:\Program Files to C:\Progra~1 If you don't understand this, go to start-->run-->command (not cmd). Type cd\ and hit enter. Then type dir. You should see all your directory names there.

Followed the instructions carefully but still got a 500 error trying to open the classig phpinfo page. After a lot of searching I discovered that everything worked fine after changing the php.ini directive fastcgi.logging from 0 to 1, contrary to what the directions said. I wonder if it was a typo on the instructions or if something changed after a few versions.

In windows XP, the php.ini file must be in c:\windows directory. Or else most of the functions will work except mysql functions. The very first mysql command mysql_connect will fail with the following message "Call to unsupported or undefined function mysql_connect(); "

To install php+apache+win32+mysql with PHP as an Apache module consider the following hints :

- download the 'VC6 x86 Thread Safe' zip file from http://windows.php.net/download/ . Couldn't make the Non Thread Safe version to work as a loadable module from Apache.

- if you set extension=php_mysql.dll and still have problems, copy the file libmysql.dll (shipped with php's zip) to your WINDOWS\System32\ directory. The apache-mysql module fails trying to find this library.