Suggestions

TLDR; Not Your Typical Privacy Agreement

Powered by Cohere

Samsung Galaxy S10e

Specifications

  • Dimensions: 142.2 x 69.9 x 7.9 mm (5.60 x 2.75 x 0.31 in)
  • Weight: 150 g (5.29 oz)
  • Display: Dynamic AMOLED, HDR10+
  • Resolution: 1080 x 2280 pixels, 19:9 ratio (~438 ppi density)
  • OS: Android 9.0 (Pie), upgradable to Android 12, One UI 4.1
  • CPU: Octa-core (2x2.73 GHz Mongoose M4 & 2x2.31 GHz Cortex-A75 & 4x1.95 GHz Cortex-A55) - EMEA/LATAM
  • Main Camera: 12 MP, f/1.5-2.4, 26mm (wide)
  • Selfie Camera: 10 MP, f/1.9, 26mm (wide), 1/3", 1.22ยตm, dual pixel PDAF
  • Battery: Li-Ion 3100 mAh, non-removable
All Notes

Installing PHP on Windows 11: A Step-by-Step Guide

March 16, 2025
Author:
Tawanda Andrew Msengezi
Share to Reddit
Share to Facebook
Share to X
Share to LinkedIn
Share to WhatsApp
Share by email
Describing the associated blog post


PHP (Hypertext Preprocessor) is one of the most widely used server-side scripting languages for web development. If you're a developer working with PHP on Windows 11, setting up the environment correctly is crucial. This guide will walk you through the steps of installing PHP.

Prerequisites

Before installing PHP, ensure you have the following:

  • A Windows 11 computer
  • Administrator access
  • A text editor (Notepad++, VS Code, or any preferred editor)

Step 1: Download PHP for Windows

  1. Open your browser and visit the official PHP download page: https://windows.php.net/download.
  2. Scroll down to the "Windows downloads" section.
  3. Choose the latest Non-Thread Safe (NTS) x64 version suitable for your system (e.g., php-8.4.5-nts-Win32-vs16-x64.zip).
  4. Click on the ZIP file to download it.

Step 2: Extract PHP Files

  1. Locate the downloaded ZIP file.
  2. Right-click on it and select Extract All.
  3. For easier reading, rename the folder to php.
  4. Choose a directory for extraction, preferably C:\php, and extract the files.

๐Ÿ’ก Tip: Avoid using directories with spaces, such as 'C:\Program Files', as this may cause issues later.

Step 3: Configure PHP

Rename php.ini

  1. Open the extracted C:\php folder.

  2. Locate the file named php.ini-development.

  3. Rename it to php.ini.

Enable Essential Extensions

  1. Open php.ini in a text editor and enable necessary extensions:

  2. Find ;extension=mysqli and remove the semi-colon (;) to enable it.

  3. Find ;extension=mbstring and remove the semi-colon (;) to enable it.

  4. Find ;extension=curl and remove the semi-colon (;) to enable it.

  5. Save the changes and close the file.

Step 4: Add PHP to Windows PATH

To run PHP from any location in the command prompt, we need to add it to the system PATH.

  1. Press Win + R, type sysdm.cpl, and press Enter.

  2. In the System Properties window, go to the Advanced tab.

  3. Click Environment Variables.

  4. Under System variables, find Path and click Edit.

  5. Click New, then type: C:\php (ensure this is the path to where the php folder previously installed is located).

  6. Click OK and close all windows.

Step 5: Verify PHP Installation

  1. Open Command Prompt (Win + R, type cmd, and press Enter).

  2. Type the following command and press Enter: php -v

  3. If PHP is installed correctly, you should see output similar to:

PHP 8.4.5 (cli) (built: ...)
Copyright (c) The PHP Group
Zend Engine v8.4.5, Copyright (c) Zend Technologies

Step 6: Test PHP (Optional)

To ensure PHP is working properly, create a simple test script.

  1. Open your text editor and create a new file named test.php in C:\php.

  2. Add the following code:

<?php
phpinfo();
?>
  1. Save the file.

  2. Open Command Prompt, navigate to C:\php, and run:

php test.php

  1. If PHP is working correctly, a list of PHP settings will be displayed.

Conclusion

Congratulations! ๐ŸŽ‰ You have successfully installed and configured PHP on Windows 11. You can now start developing PHP applications locally. If you're using PHP for web development, consider installing a web server like Apache or Nginx and a database server like MySQL.

Let me know using the contact form if you encounter any issues or have additional questions. Happy coding! ๐Ÿš€

Tawanda Andrew Msengezi

Tawanda Andrew Msengezi is a Software Engineer and Technical Writer who writes all the articles on this blog. He has a Bachelor of Science in Computer Information Systems from Near East University. He is an expert in all things web development with a specific focus on frontend development. This blog contains articles about HTML, CSS, JavaScript and various other tech related content.

User Notice

Dear Visitor,

This website stores your color theme preference, you can toggle your theme preference using the lightbulb icon in the top right of the webpage.

Clicking on the robot icon that says "Chat" in the bottom-left corner will open a chat with an AI assistant. Click the button below to close this message.