PHP Installation on Windows Using WAMP Server
This tutorial will guide you through installing PHP on Windows using the WAMP server. WAMP stands for Windows, Apache, MySQL, and PHP. WAMP makes it easy to set up a local server on your Windows computer to develop and test PHP applications.
Step 1: Download WAMP Server
Step 2: Install WAMP Server
Step 3: Start and Configure WAMP Server
Step 4: Test PHP Installation
Step 1: Download WAMP Server
- Open your web browser.
- Visit the official WAMP server website.
- Click on the Download link for the latest version.
- Choose the correct version for your Windows system (32-bit or 64-bit).
- Save the installer file to your computer.
- Click Here to Download Microsoft VC packages
Step 2: Install WAMP Server
- Locate the downloaded installer file (for example,
wampserver-x.x.x.exe). - Double-click the installer to run it.
- Follow the on-screen instructions:
- License Agreement: Read and accept the license agreement.
- Installation Folder: Choose a folder (the default is usually
C:wamporC:wamp64for 64-bit systems). It is best to use the default location. - Additional Requirements: The installer might check for required software (such as Microsoft Visual C++ Redistributable packages). If prompted, download and install the missing components.
- Once the installation is complete, you may be asked to choose your default browser and text editor. You can keep the defaults or select your preferred applications.
- Click Finish to complete the installation.
Step 3: Start and Configure WAMP Server
- Launch WAMP Server:
- After installation, launch WAMP Server by clicking its desktop icon or finding it in the Start Menu.
- Check the WAMP Icon:
- Look at the WAMP server icon in the system tray (located in the bottom-right corner of your screen).
- When WAMP Server is running correctly, the icon will be green. If it’s red or orange, it indicates that not all services have started properly.
- Access the WAMP Dashboard:
- Left-click the WAMP icon in the system tray.
- Select Localhost from the menu, or open your web browser and type
http://localhost/in the address bar. - You should see the WAMP server homepage, which confirms that Apache and MySQL are working.
Step 4: Test PHP Installation
- Create a PHP Info File:
- Navigate to the www directory inside your WAMP installation folder. By default, this is located at:
- Create a new file named
info.phpusing a text editor (such as Notepad or the text editor you selected during installation).
- Navigate to the www directory inside your WAMP installation folder. By default, this is located at:
- Add PHP Code:
- Open
info.phpand add the following code:<?php phpinfo(); ?>
- Open
- Save the File and close the text editor.
- View in Browser:
- Open your web browser and go to: http://localhost/info.php
- You should see a page displaying detailed information about your PHP installation, including the PHP version, configuration settings, and loaded modules.