Arwaz Khan
Posted on April 28, 2021
Hello Dev's
In this blog, we will learn how to set up a PHP console.
Why we need this?
PHP is a server-side language (Backend) of web development.
In general, we don't require to take input from the console but sometimes for a small function or block of code, we require this because we don't want to disturb our whole code. It is also required to run some code that does not require a webpage (Interface) or sometimes we must require to take input from the console.
Requirements?
- Server: Xampp or WampServer
How to set up this?
First, we have to set up a path in our system environment variable.
Step 1: Goto C drive where your Xampp is installed
Step 2: Goto php folder in Xampp folder
Step 3: Copy the path of that folder
Step 4: Now Goto System Properties then Advance System Settings
Step 5: Goto Environment Variables and follow the below steps and paste the copied path and press ok ok ok...
Now How to run the php file?
Step 1: open command prompt go to the directory where your code is saved ...
you can use cd command like cd C:\xampp\htdocs
Now to run php code use this command -> php file_name.php
Hope you will understand 😊....
If you have any problem you can comment below.
Thankyou 🙏
Posted on April 28, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.