blob: 412a7736379d050257d4995745a213645530d236 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
---
extends: _layouts.post
section: content
title: Installing PHP 8 for Windows 10
description: A guide to how to install PHP 8 for Windows 10.
tags: [PHP]
---
## Getting Started
The [PHP For Windows](https://windows.php.net) site provides pre-built Windows binaries for you to [download](https://windows.php.net/download/). Which version you download depends upon two things.
1. Is your system a 64 or 32 bit machine.
2. Are you planning to use IIS or Apache as the web server.
For 64 bit systems the *x64* file should be downloaded. If you plan to use IIS then get the *Non Thread Safe (NTS)* version otherwise use the *Thread Safe (TS)* version.
The PHP 8 binaries require to have the *Visual C++ Redistributable for Visual Studio 2015-2019* be installed as well.
The below table links to the appropriate section where you will find the *Zip* archive to download as well as the appropriate VC redistributable executable.
| Architecture | [Internet Information Services (IIS)](https://www.iis.net/)| [Apache](https://httpd.apache.org/) | VS16 |
|--------------|------------------------------------------------------------|-------------------------------------|------|
| 32 Bit | [VS16 x86 Non Thread Safe](https://windows.php.net/download/#php-8.0-nts-vs16-x86) | [VS16 x86 Thread Safe](https://windows.php.net/download/#php-8.0-ts-vs16-x86) | [VS16 x86](https://aka.ms/vs/16/release/VC_redist.x86.exe)
| 64 Bit | [VS16 x64 Non Thread Safe](https://windows.php.net/download/#php-8.0-nts-vs16-x64) | [VS16 x64 Thread Safe](https://windows.php.net/download/#php-8.0-ts-vs16-x64) | [VS16 x64](https://aka.ms/vs/16/release/VC_redist.x64.exe) |
## Download and Installation
1. Download the *Visual C++ Redistributable for Visual Studio 2015-2019* executable and install it.
2. Download the appropriate PHP 8 Zip archive for your Windows system.
3. Extract the Zip archive into a folder called php in your user folder. This should result in a folder at `C:\Users\[username]\php`.
## Configuring Windows
In order to run the PHP executable from the command line the path to where the Zip archive was extracted to needs to be added to the Windows *Path* environment variable.
1. Right click on the start menu and select *System*.
2. Type *Control Panel* into the search field and select the *Control Panel* option when it appears.
3. Click *System and Security* and then the *System* option.
4. Click *Advanced system settings* from the left side menu to bring up a dialog box.
5. Select the *Advanced* tab and then click *Environment Variables*.
6. Select the *Path* option from the *User variables* list and click *Edit*.
7. Click *New* and enter the path to where you extracted the Zip archive. This should be `C:\Users\[username]\php`. You can also click *Browse* instead and navigate to the folder.
8. Click *OK* to close the *Edit environment variable* dialog.
9. Click *OK* again to close the *Environment Variables* dialog.
10. Click *OK* for a third time to close the *System Properties* dialog.
## Checking Installation
Open up either *PowerShell* or the *Command Prompt* and enter `php -v` to verify that PHP was installed correctly. You should see output similar to that shown below.
```shell
C:\Users\dev>php -v
PHP 8.0.1 (cli) (built: Jan 5 2021 23:43:33) ( NTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
```
|