David Stockdale's Scrapcode

How to install PHP on windows 10

Recently I had a tech test for a job application.

In that test I learned and relearned a lot of things.

The biggest thing I learned was that most guides for simple things like installing PHP are terrible!

So here’s how to install PHP on a Windows 10 Computer.

First download PHP

Go to this address:

https://www.php.net/downloads.php

Then find the windows download of the latest stable version:

Download the zip file of the appropriate thread safe version.

Extract the file.

Then find the file “php.ini-development” and make a copy of it.

Next rename that file “php.ini” and then open it with notepad.

Find the line “; extension_dir = “ext”” and change it to “extension_dir = “ext””.

If you want to enable some other extensions like sqlite3 you can find them by searching for “extension=”.

Now rename the folder to “PHP8” (replace 8 with whatever version number php you downloaded (no decimals!)) and move it to “C:\” on your computer.

Now we need to make sure your computer knows where to find it, so search “variables” on your start menu and you’l find “Edit the system environment variables”.

In the system variables find “Path” and edit it.

Now finally simply add a new variable “C:\PHP8” (or whatever version PHP you downloaded).

To test that everything works simply open your command prompt and input “php -v” to check your PHP version.

And voilà! You have PHP!

Leave a Reply