How to install php on windows
How to install php on windows
How to Install PHP on Windows
In this article, we’re going to discuss how to install PHP on Windows. There are three different ways to install and run PHP on Windows, and we’ll look at each one.
PHP is a server-side scripting language which is mostly used to build web applications—these may range from a very simple blog website to a full-fledged eCommerce store. In fact, PHP is one of the most popular server-side scripting languages for web development.
In the next section, we’ll go through the prerequisites for installing PHP on your Windows computer.
Prerequisites
Before we install PHP, let’s make sure of the following things.
The first thing to check is the Windows version. If you’re using a Windows version older than Windows 2008/Vista, you won’t be able to install PHP versions that are greater than 5.5. As per the official documentation, as of the PHP 7.2.0 version, Windows 2008 and Windows Vista are not supported.
Thus, it’s important to be sure that your Windows version aligns with the PHP version you want to install.
In the next section, we’ll discuss different ways to install PHP. If you want to install PHP manually, you should be comfortable editing a few system files since that is part of the manual installation process. On the other hand, if you just use the all-in-one package, it will be pretty straightforward, and all the configuration will happen automatically.
Today, we’re going to install the latest stable version of PHP, which is 7.4. In fact, PHP has several different versions, and if you want to install a different version of PHP and are facing any difficulties, drop me a line in the comments section and I’ll be happy to help.
With that out of the way, let’s get started installing PHP!
Possible Ways to Install PHP on Windows
In this section, I’ll briefly discuss the different ways you can install PHP on Windows.
Manual Installation
In the manual installation process, apart from downloading the PHP package, you need to go through a couple of steps to properly configure it. As I said earlier, if you prefer manual installation, you should be comfortable enough to edit a few configuration files in the text editor.
All-in-One Packages
There are a couple of popular Windows PHP distributions that come as all-in-one packages. Apart from PHP, these also install and configure the Apache web server and a MySQL database server. These packages are really useful for developers who want to set up and run the full web development stack quickly and easily.
XAMPP and WampServer are two of the most popular Windows distributions among the PHP community.
Using a .msi Installer
I would say this was one of the easiest and most preferred ways to install PHP among newbies. But it’s deprecated and not recommended anymore. To install PHP with an installer, you just need to download the .msi installer and run it to install PHP just like any other software you install on Windows.
However, as of PHP 5.4.0, you won’t find the .msi installer files on the PHP downloads page. So this is only going to be useful if you want to install an older PHP version. As it’s deprecated, we won’t discuss this installation method in detail.
How to Install PHP on Windows Manually
In this section, we’ll go through the steps that are required in order to install PHP in your Windows installation manually.
Download and Extract the PHP Package Files
The first thing you have to do is to download the PHP package file of your choice from the official PHP downloads page.
You’ll find .zip files available for both x86 and x64 systems, so make sure to download the correct one as per your Windows OS architecture. Also, you’ll have to choose either to download the non-thread-safe or thread-safe version of PHP. If you’re planning to run PHP as an Apache module, the thread-safe version is recommended. However, if you want to run PHP as a CGI module, you can choose either of them!
Next, you need to extract the .zip file in the directory where you want to install PHP. A common install location is C:\php. Create the php directory and extract the .zip file contents inside the C:\php directory.
Configure the php.ini Configuration File
In this section, we’ll discuss the necessary changes you need to make in the php.ini configuration file.
The PHP package that you’ve just downloaded already contains two different versions of the configuration file: php.ini-development and php.ini-production. The php.ini-development file is designed and configured for your local development. This has a lot of features enabled which make it easier to test and debug your code, but it makes your software run slower and is not secure for a live site. On the other hand, the php.ini-production file is designed for optimum performance and security. We’re going to use the php.ini-production file.
As PHP detects the php.ini file as its configuration file, you’ll have to copy the file which you choose for your local development, and rename it to the php.ini file. As we’re going to use the production version, copy the php.ini-production file to the C:\php\php.ini file.
Next, open the php.ini file in your favorite text editor and find the following line.
It’s the path of the PHP extensions directory, and let’s change it as shown in the following snippet.
It’s important to note that we’ve also removed the semicolon in front of the line to make sure it’s not commented. Of course, you need to adjust the above path to match your installation directory.
And with that, we’ve finished the php.ini configuration file changes.
Configure the PATH Environment Variable
In this final section, we’ll see how to add the PHP installation path to the PATH environment variable. The process of updating the PATH variable in Windows changes from version to version. I’ll show you how to change it in Windows 10, but feel free to ask me if you’re using a different version.
In the Windows search bar, just type the environment keyword and choose Edit the system environment variables in the search results. Go to the Advanced > Environment Variables section. Edit the PATH environment variable and add ;C:\php to the end. This will make it so you can run PHP just by typing php from the command prompt, no matter what folder you’re in.
Finally, reboot the system, and you’re done. You’ve successfully installed PHP in your Windows installation!
Installing With an All-in-One Package
As I mentioned earlier, XAMPP and WampServer are popular all-in-one packages that allow you to install PHP along with the other essential web development components like a web server and database server.
Irrespective of the tool you choose, the process of installing these tools is pretty straightforward. You just need to download the corresponding installer and run it to install it in your Windows installation. We won’t go into the details of this, but if you have any queries regarding this, feel free to post them.
In the next section, we’ll see how to enable specific PHP extensions in your PHP installation.
How to Install PHP Extensions
In this section, we’ll see how to enable PHP extensions.
Every time you want to enable a specific extension in PHP, you just need to find the associated entry in the php.ini configuration file and uncomment it.
For example, let’s say you want to enable the mysqli extension. Then you need to search for the extension=mysqli entry in the php.ini file and uncomment it, as shown in the following snippet.
In the same way, you can enable other extensions as well.
Learn PHP With a Free Online Course
If you want to learn PHP, check out our free online course on PHP fundamentals!
In this course, you’ll learn the fundamentals of PHP programming. You’ll start with the basics, learning how PHP works and writing simple PHP loops and functions. Then you’ll build up to coding classes for simple object-oriented programming (OOP).
Along the way, you’ll learn all the most important skills for writing apps for the web: you’ll get a chance to practice responding to GET and POST requests, parsing JSON, authenticating users, and using a MySQL database.
Install and Configure PHP
The fastest and easiest way to install PHP on Internet Information Services (IIS) is by using the MicrosoftВ® Web Platform Installer (Web PI). Web PI completely automates setting up IIS, FastCGI, and the latest version of PHP from the php.net Web site. With Web PI, you can navigate to the «Web Platform» tab and select «PHP» under «Framework and Runtimes» customize link. Alternately, use the instructions that follow as guidance for installing PHP with WindowsВ® Installer or using a compressed (Zip) file installation.
There are two builds for each PHP version: one is thread-safe, and one is not (referred to as the non-thread-safe [NTS] version). The thread-safe version is designed for environments where the Web server core can keep the PHP engine in memory, running multiple treads of execution for different Web requests simultaneously. The architecture of IIS and the FastCGI extension provide an isolation model that keeps requests separate, removing the need for a thread-safe version. The NTS version does not have any of the code that allows PHP to manage multiple threads. As a result, there is a performance improvement on IIS when using the NTS version when compared to the tread-safe version because the NTS version avoids unnecessary thread-safety checks (FastCGI ensures a single-threaded execution environment).
Install PHP
There are two main ways to install PHP on a WindowsВ®-based computer: download the Windows Installer or use the Windows Zip file from the PHP Web site. Either method will get PHP working, but both have some extra steps that are needed to make PHP work well.
Windows Installer
The Windows Installer version can get a complete PHP environment up and running, but the installation of extensions can be confusing. By default, no extensions are installed, and this can adversely affect the usefulness of the PHP installation. Alternately, all of the extensions can be installed; this results in an unstable system because some of the extensions can conflict with others. It is generally easier to use the Zip file installation.
Zip File Installation
To use the Zip file installation, follow the instructions in Using FastCGI to Host PHP Applications on IIS 7.0 and Above. The Zip file installation installs many of the extensions that are available for the Windows Installer version; however, none of the extensions are enabled until their entries in the Php.ini file are set up.
Download the latest non-thread-safe Zip file package with binaries of PHP. Under Windows Binaries, click on the most current PHP non-thread-safe Zip package to download the PHP files.
Unpack the files to a directory of your choice (for example, C:\PHP ) on your IIS server.
Rename the Php.ini-recommended to php.ini.
Open the Php.ini file in a text editor, then uncomment and modify settings as follows:
Set fastcgi.impersonate = 1.
FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under.
Set cgi.fix_pathinfo = 0
The cgi.fix_pathinfo provides PATH_INFO/PATH_TRANSLATED support for Common Gateway Interface (CGI). Setting this to 1 will cause PHP CGI to fix its paths to conform to the specification.
Set cgi.force_redirect = 0.
Set open_basedir to point to a folder or network path where the content of the Web site(s) is located.
Set extension_dir to point to a location where PHP extensions reside. For PHP 5.2.X, this is typically extension_dir = «./ext».
Set error_log=»C:php_errors.log»
This can help with troubleshooting.
Enable the required PHP extension by un-commenting corresponding lines. More information follows in the section, Extensions.
Figure 1 Windows extensions
Click on Start, Settings, Control Panel, and then double-click on the System icon (using the class view).
Click on the Advanced system settings link in the left column.
From the System Properties window, click on the Advanced tab, and then click on the Environment Variables button at the bottom.
Select the Path variable from the System Variables section, and then click on Edit. Add: c:\php to your system path.
Figure 2: Edit System Variable
Click OK until you have exited the System Properties window.
Start IIS Manager by clicking on Start, Programs, Administrative Tools, and then Internet Information Services (IIS) Manager.
From the IIS Manager, click on the hostname of your server in the Connections panel on the left.
Double-click on the Handler Mappings icon.
Figure 3: Internet Information Services (IIS) Manager
From the Handler Mappings Actions panel, click on Add Module Mapping.
Figure 4: Handler Mappings
Type the following information into the appropriate text boxes, and then click OK.
Figure 5: Add Script Map
Click OK, and then click Yes.
In the left panel, click on your server’s hostname, and then double-click on the Default Document icon.
From the Actions panel on the right, click Add.
Enter index.php as the new default document name, and then click OK.
Enter default.php as the new default document name, and then click OK.
In the left panel, click on your server’s hostname.
In the Actions panel on the right, click Restart.
Create a new text document, and save it as c:\inetpub\wwwroot\phpinfo.php with the following content:
Figure 6: PHP information page
Extensions
It is important to determine which extensions are needed by the applications that will be running and then to limit the installed extensions to only those. For a typical open-source application installation, for example, the following extensions are installed:
PHP.INI File Settings
The Php.ini file provides PHP with configuration and environmental information. Below are a number of settings for the Php.ini file that help PHP work better with Windows.
Required Settings
Optional Settings
Enable PHP Session State
In WindowsВ® Explorer, create the session subdirectory in the PHP installation directory.
Right-click the session directory, and select Properties.
In the Security tab, click Edit.
Click Add, and enter IIS_IUSRS for Enter the object names to select.
Click OK.
Select the Modify permission check box, and click OK.
Figure 7: Permissions for session folder
Click OK in the Session Properties window.
Open php.ini in the PHP installation directory, and set the session.save_path setting to the session subdirectory:
Save and close the file.
Click Start, and then select Command Prompt.
Type runas /user:administrator cmd.exe to enable elevated permissions.
Type iisreset at the command prompt, and then press the ENTER key.
Figure 8: IISRESET command
Note that PHP uses file-based session state by default. You can modify a number of additional session settings, including whether cookie or URL sessions should be used, and whether sessions are created on the first request or need to be explicitly created.
Create a folder and rename it phpapp.
Create session.php in the phpapp directory.
Paste the following into it:
Save and close the file.
Figure 9: Using session state
Observe that the counter is 1.
Request http://localhost/phpapp/session.php again, or press F5.
Figure 10: Using session state
Observe that the counter is 2.
This article uses information from «Using FastCGI to Host PHP Applications on IIS 7.0 and Above» by Ruslan Yakushev, published on December 5, 2007.
Installation on Windows systems
Table of Contents
Installing PHP on modern Microsoft Windows systems and recommended configuration with common web servers.
The Official releases of PHP on Windows are recommended for production use. However, you are welcome to build PHP from Source. You will need a Visual Studio environment. See » Step by Step Build Instructions.
Installing PHP on Azure App Services (aka Microsoft Azure, Windows Azure, or (Windows) Azure Web Apps).
User Contributed Notes 12 notes
If you make changes to your PHP.ini file, consider the following.
(I’m running IIS5 on W2K server. I don’t know about 2K3)
PHP will not «take» the changes until the webserver is restarted, and that doesn’t mean through the MMC. Usually folks just reboot. But you can also use the following commands, for a much faster «turnaround». At a command line prompt, type:
and that will stop the webserver service. Then type:
net start w3svc
and that will start the webserver service again. MUCH faster than a reboot, and you can check your changes faster as a result with the old:
in your page somewhere.
I wish I could remember where I read this tip; it isn’t anything I came up with.
You can have multiple versions of PHP running on the same Apache server. I have seen many different solutions pointing at achieving this, but most of them required installing additional instances of Apache, redirecting ports/hosts, etc., which was not satisfying for me.
Finally, I have come up with the simplest solution I’ve seen so far, limited to reconfiguring Apache’s httpd.conf.
Here it is (Apache’s httpd.conf contents):
—————————
# replace with your PHP4 directory
ScriptAlias /php4/ «c:/usr/php4/»
# replace with your PHP5 directory
ScriptAlias /php5/ «c:/usr/php5/»
# populate this for every directory with PHP4 code
Action application/x-httpd-php «/php4/php.exe»
# directory where your PHP4 php.ini file is located at
SetEnv PHPRC «c:/usr/php4»
# remember to put this section below the above
# directory where your PHP5 php.ini file is located at
SetEnv PHPRC «c:/usr/php5»
—————————
This solution is not limited to having only two parallel versions of PHP. You can play with httpd.conf contents to have as many PHP versions configured as you want.
You can also use multiple php.ini configuration files for the same PHP version (but for different DocumentRoot subfolders), which might be useful in some cases.
Remember to put your php.ini files in directories specified in lines «SetEnv PHPRC. «, and make sure that there’s no php.ini files in other directories (such as c:\windows in Windows).
Hope this helps someone.
If you get 404 page not found on Windows/IIS5, have a look at C:\SYSTEM32\INETSRV\URLSCAN
I made the mistake of setting a ‘wildcard application map’ for PHP on a Windows 2003 / IIS 6.0 / PHP ISAPI installation.
This resulted in «No input file specified» errors whenever I tried to load the default page in my site’s directories. I don’t know why this broke things, but it did.
If anyone has the same problem, this may be the cause.
If you are installing PHP on Vista just go to David Wang’s blog. http://blogs.msdn.com/david.wang/
archive/2006/06/21/HOWTO-Install-and-Run-PHP-on-IIS7-Part-2.aspx
Still Can’t Run PHP Code?
After installing php-5.2.5-win32-installer.msi on my Windows XP2. with IIS5.1 it still didn’t run PHP files.
I eventually found the fix*:
1. Goto Control Panel>System>Advanced>Environmental Variables
2. Add a New System Variable «PHRC» and set its path as «C:\Program Files\PHP»
3. Restart
IIS setup: 403 forbidden error.
Despite this, php version 5.1.4 was being loaded. We renamed 5.1.4’s folder and then PHP was not loading at all.
There were no visible references to 5.1.4 in the IIS configuration, but in the file \webConfig.xml, there was a reference to 5.1.4’s isapi under IISFilters.
To fix this problem, we added version 5.2.5’s php5isapi.dll to the ISAPI Filter category for the web site, in the IIS control panel.
I installed by Microsoft Installer, manually, whatever I always received de same error from IIS7.
The IIS7 interface is quite diferent and are not all together like IIS6
The 5.3 version have not any of those files: php5stdll, php5isapi.dll. etc.
The installer puts others files in handlers and I decided to use them as substitutes. Nothing done!
After that, I discovered that installer do not install these files within the sites, but in the root default site configuration of IIS7.
So, I copied the root configuration to my site and them it worked (all others procedures were done e.g. copy php.ini to windows folder)
Testing Date: 05.15.09
Background:
For several days now I, as a newbie, have been unsure if I had installed PHP correctly, or not. No matter what I did phpinfo( ) reported «Configuratin File Path» as: “C:\WINDOWS”. I was left to wonder what was wrong.
To help resolve the phpinfo() “issue”, I conducted a series of tests using two scripts:
The first is “test-php-ini-loaded.php”; it is stored in c:\inetpub\wwwroot, and has the following code:
How to Install PHP on Windows 10 (with Apache & MySQL)
This article explains how to install PHP 8 and Apache 2.4 on Windows 10 (64-bit).
Linux and macOS users often have Apache and PHP pre-installed or available via package managers. Windows 10 requires a little more effort. The steps below may work with other editions of Windows, PHP, and Apache, but check the documentation of each dependency for specific instructions.
Why PHP?
PHP remains the most widespread and popular server-side scripting language in web development.
It’s installed by most web hosts, and has a simple learning curve, close ties with the MySQL database, superb documentation, and an excellent collection of libraries to cut your development time.
PHP may not be perfect, but it should be considered as an option for your next web application. It’s the language of choice for Facebook, Slack, Wikipedia, MailChimp, Etsy, and WordPress — the Content Management System which powers 40% of the web.
Why Install PHP Locally?
Installing PHP on your development PC allows you to safely create and test websites and applications without affecting the data or systems on your live server.
Alternative Installation Options
Before you jump in, there may be a simpler installation options…
Use an All-in-One package
All-in-one packages are available for Windows which contain Apache, PHP, MySQL, and many other dependencies in a single installation file — such as XAMPP, WampServer and Web.Developer.
These packages are easy to use, but they may not exactly match your live server. Installing Apache and PHP manually will help you learn more about the system and configuration options.
Use a Linux Virtual Machine
Microsoft Hyper-V (provided in Windows 10 Professional) and VirtualBox are free hypervisors which emulate a PC so you can install another operating system.
You can install any version of Linux, then follow its Apache and PHP installation instructions. Alternatively, distros such as Ubuntu Server provide them as standard (although they’re rarely the latest editions).
Use Windows Subsystem for Linux 2
WSL2 is also a virtual machine, but it’s tightly integrated into Windows so activities such as file sharing and localhost resolution is seamless. You can install several Linux distros, so refer to the appropriate Apache and PHP instructions.
Use Docker
Docker creates a wrapper (known as a container) around pre-configured application dependencies such as Apache, PHP, MySQL, MongoDB, and most other web software. Containers look like full Linux Virtual Machines but are considerably more lightweight.
Docker is currently considered the best option for setting up a PHP development environment. Read our complete guide to setting up a PHP development environment with Docker.
Install Apache (optional)
If you’re still reading, the following sections describe how to install Apache and PHP directly on Windows.
PHP pages can then be viewed in a browser at http://localhost:8000.
This may be adequate for quick tests, but your live server will use Apache or similar web server software. Emulating that environment as closely as possible will prevent development errors.
To install Apache, download the latest Win64 ZIP file from https://www.apachelounge.com/download/ and extract its Apache24 folder to the root of your C: drive. You’ll also need to install the Visual C++ Redistributable for Visual Studio 2015–2019 ( vc_redist_x64 ); a link is provided on the same page.
Open a cmd command prompt (not PowerShell) and start Apache with:
You may need to accept a firewall exception before the server starts to run. Open http://localhost in a browser and an “It works!” message should appear. Note:
Also not that, if Apache won’t start, it’s likely another application is hogging port 80. (Skype is the prime candidate and the Windows 10 app won’t let you disable it!) If this occurs, edit C:\Apache24\conf\httpd.conf and change the line Listen 80 to Listen 8080 or any other free port. Restart Apache and, from that point onward, you can load web files at http://localhost:8080
How to Install PHP
Install PHP by following the steps below. Note that there are several ways to configure Apache and PHP, but this is possibly the quickest method.
Step 1: Download the PHP files
You’ll need the PHP Windows installer. There are a number of versions of PHP available. Make sure you get the latest PHP 8 x64 Thread Safe ZIP package from https://www.php.net/downloads.php.
Step 2: Extract the files
Create a new php folder in the root of your C:\ drive and extract the contents of the ZIP into it.
PHP can be installed anywhere on your system, but you’ll need to change the paths referenced below if C:\php isn’t used.
Step 3: Configure php.ini
There are several lines you may need to change in a text editor (use search to find the current value). In most cases, you’ll need to remove a leading semicolon ( ; ) to uncomment a setting.
First, enable any required extensions. This will depend on the libraries you want to use, but the following extensions should be suitable for most applications:
If you want to send emails using PHP’s mail() function, enter the details of an SMTP server in the [mail function] section (your ISP’s server should be suitable):
Step 4: Add C:\php to the path environment variable
To ensure Windows can find the PHP executable, you need to change the PATH environment variable. Click the Windows Start button and type “environment”, then click Edit the system environment variables. Select the Advanced tab, and click the Environment Variables button.
Scroll down the System variables list and click Path followed by the Edit button. Click New and add C:\php :
Note that older editions of Windows have a single text box where each path is separated by a semi-colon ( ; ).
Click OK until you’re out. You shouldn’t need to reboot, but you may need to close and restart any cmd terminals you have open.
Step 5: Configure PHP as an Apache module
Ensure Apache isn’t running and open its C:\Apache24\conf\httpd.conf configuration file in a text editor. Add the following lines to the bottom of the file to set PHP as an Apache module (change the file locations if necessary):
Optionally, change the DirectoryIndex setting to load index.php instead of index.html when it can be found. The initial setting is:
Save httpd.conf and test the updates from a cmd command line:
Syntax OK should appear … unless you have errors in your configuration.
Step 6: Test a PHP file
Create a new file named index.php in Apache’s web page root folder at C:\Apache24\htdocs and add the following PHP code:
Open a web browser and enter your server address: http://localhost/. A “PHP version” page will appear showing the various PHP and Apache configuration settings.
If you’re more comfortable with Linux, you might prefer to set up your PHP environment under Windows Subsystem for Linux 2. Check out our WSL2 guide and in-depth Windows Terminal tutorial for more.
Share This Article
Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he’s been advocating standards, accessibility, and best-practice HTML5 techniques. He’s created enterprise specifications, websites and online applications for companies and organisations including the UK Parliament, the European Parliament, the Department of Energy & Climate Change, Microsoft, and more. He’s written more than 1,000 articles for SitePoint and you can find him @craigbuckler.
How to Install PHP 8 on Windows
In this post, we’ll learn how to install PHP 8 on Windows.
Why Developing with PHP?
PHP is one of the most popular server-side programming languages on the world. It is installed by most web hosts, has an easy learning curve, close ties with the MySQL database, and a good number of libraries to improve your productivity. PHP may not be perfect, but it should certainly be considered for your next web application. Both Yahoo and Facebook use it with great success.
Recently PHP 8 was released with many new features and improvements such as named parameters, attributes, union types, constructor properties,
Why Install PHP 8 Locally?
Having PHP 8 installed on your development machine enables you to create web applications without risking the production data or resources on your real-world website. This post will teach you how to install PHP 8 in the Windows version of Apache.
All-in-One packages
There are some excellent all-in-one Windows distributions that contain Apache, PHP 8, MySQL and other applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer and Web.Developer. There is nothing wrong with using these packages, although manually installing Apache and PHP will help you learn more about the system and its configuration options.
The PHP Installer
Although an installer is available from php.net, I would recommend the manual installation if you already have a web server configured and running.
Manual Installation
Manual installation offers several benefits:
Step 1: Download the files
Download the latest PHP 8 ZIP package from www.php.net/downloads.php
As always, virus scan the file and check its MD5 checksum using a tool such as fsum.
Step 2: Extract the files
PHP 8 can be installed anywhere on your system, but you will need to change the paths referenced in the following steps.
Step 3: Configure php.ini
Define the extension directory:
Enable extensions. This will depend on the libraries you want to use, but the following extensions should be suitable for the majority of applications:
If you want to send emails using the PHP 8 mail() function, enter the details of an SMTP server (your ISP’s server should be suitable):
Step 4: Add C:\php to the path environment variable
To ensure Windows can find PHP 8, you need to change the path environment variable. Open Settings, type ‘environment variables’ into the search field and open the result. Select the “Advanced” tab, and click the “Environment Variables” button.
Scroll down the System variables list and click on “Path” followed by the “Edit” button. Click “Edit text” and add ;C:\php to the end of the Variable value line (remember the semicolon).
Now click OK until you’re out. You might need to reboot at this stage.
Build faster websites and apps
Learn the skills to boosting your data-driven web apps performance
Step 5: Configure PHP 8 as an Apache module
Ensure Apache is not running (use net stop Apache2.2 from the command line) and open its confhttpd.conf configuration file in an editor. The following lines should be changed:
On line 239, add index.php as a default file name:
At the bottom of the file, add the following lines (change the PHP file locations if necessary):
Save the configuration file and test it from the command line (Start > Run > cmd):