Tuesday, October 7, 2025
HomeLanguagesHow to set up a PHP Console ?

How to set up a PHP Console ?

PHP is a backend server-side language of web development. In general, we don’t need to take input from the console but sometimes we need to run a small function or block of code, for which we need to take input from the console.

Requirements:

Server: xampp or WampServer

How to set up PHP Console ?

Step 1: Go to C drive where your XAMPP is installed.

xampp

Step 2: Go to PHP folder in XAMPP folder

php folder

Step 3: Copy the path of that folder

c\xampp\php

Step 4: Go to System Properties then Advanced System Settings

Advanced system settings

Step 5: Goto Environment Variables and follow the below steps and paste the copied path and press ok.

Environment variables

new

c\xampp\php

Running PHP file: Open command prompt, go to the directory where your code is saved.

cd C:\xampp\htdocs

use this command to run php code

php file_name.php

cmd

RELATED ARTICLES

Most Popular

Dominic
32340 POSTS0 COMMENTS
Milvus
86 POSTS0 COMMENTS
Nango Kala
6708 POSTS0 COMMENTS
Nicole Veronica
11872 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11936 POSTS0 COMMENTS
Shaida Kate Naidoo
6829 POSTS0 COMMENTS
Ted Musemwa
7090 POSTS0 COMMENTS
Thapelo Manthata
6780 POSTS0 COMMENTS
Umr Jansen
6784 POSTS0 COMMENTS