PHP on Localhost (SIMPLE)

Install on Mac :

Install PHP 7.3

curl -s | bash -s 7.3

Install PHP 7.2

curl -s | bash -s 7.2

Install PHP 7.1

curl -s | bash -s 7.1

Install PHP 5.6 — Running with OSX 10.11 El Capitan or lower versions.

curl -s | bash -s 5.6

Install on Windows :

for windows user … oh J christ … follow these instructions on “site point” it is too long to be fit inside this small and quick tutorial

just make a folder for instance :

Windows : C:/folder/index.php


Mac :


Then Open Terminal or Command prompt on Windows

Navigate to that folder : cd [folder]

type this command :

php -S localhost:4000

that 4000 is the port and localhost is where u can run the local server

any code inside index.php in ur folder with php codes will be shown inside localhost:4000 … just open localhost:4000 in ur browser



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