how to install php 8 (or oldest) in Windows 10

Download

Get PHP ZIP files from https://windows.php.net/download/ , choose a latest version, I normally install Thread Safe Version!

Check if you has VC15 and VS16 installed in Window 10, if not, install from here https://aka.ms/vs/16/release/VC_redist.x64.exe or https://aka.ms/vs/16/release/VC_redist.x86.exe, according your Windows build.

Unzip PHP

Unzip PHP files into folder, sample:

C:\php\8.0

Enter in folder and rename file php.ini-development to php.ini, open it in text editor

Uncomment the line extension_dir (only remove ; from the front), the result is:

extension_dir = "ext"

Uncomment lines of the extensions bz2, curl, fileinfo, gd, intl, mbstring, mysqli, openssl, pdo_mysql, pdo_pgsql, sodium, sqlite3, xsl …. example:

extension=bz2
extension=curl
;extension=ffi

Note: extensions are allowed only removing “;” from the front

Copy PHP install folder and include in Path Variable (System Variables) in Windows Enviromnennt Variables, chose Path (System Variables), sample: C:\php\8.0

Check Install

Open Power Shell and type

php -v

Results show php version

Composer Install

Download Composer from https://getcomposer.org/Composer-Setup.exe

Install from All Users

Uncheck Developer mode and click Next

Choose command line PHP executable and click next

Proxy normally is not necessary, click next, install, next and finish!

Testing instalation

Open Power Sheel and run

composer create-project --prefer-dist laravel/laravel blog
cd blog
php artisan serve

Open your browser and check if http://localhost:8000 show Laravel First Page

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tiago Heineck

Tiago Heineck

Só mais um “bocó” em um mundo de “bocós”