how to run your PHP program on Visual Studio Code

In order to run PHP code on VS Code you must first install xampp as well as the visual studio code on your machine.

if you installed both of them then go to xampp directory.

simply go to C drive click on XAMPP folder and then create new folder inside htdocs and name the folder.

after that click your created folder and inside your created folder right click on it then click “New” then choose “Text document”.

name the text as you want like for example “first project” and don’t forget the “.php” extension.

after that start the XAMPP control panel.
go to start search for XAMPP control panel and then start the apache server.

after that open your visual studio code on your machine and open the folder you created.


in order to view your project output simply open your browser search for “localhost/the folder name/program file” like for example is “localhost/my first project/first project.php”.

then here is the output of your first project on PHP using visual studio code.


that’s all for today’s blog I hope it help you to build your first project.

Leave a Comment

Your email address will not be published. Required fields are marked *