How to Create PHP Project in Visual Studio Code (VSCode) - 2024 Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's see how we can install PHP and create PHP project and run PHP project from Visual Studio code so let's get started first go to this URL you can click on the link in the description below and here click on Windows download now you get a bunch of options here so there's a thread safe version and there is a non-thread safe version now both will work fine if your application needs to be thread safe click on this and if your application is not has safe you can click on this I click on this because it will work for both the cases and let's wait till this is downloaded so once the pH file is downloaded just click on this button click on Cut and we'll go to our C drive and we'll paste it here now right click on this and click on extract all and let's change the folder name here to just PHP because we will have to later add this to envirment variable C on extract and let's wait till everything is extracted once it is extracted you will see a new folder here called PHP go inside this folder and click on this and copy this path here and press your Windows key and type environment variables click on this click on environment variables and click on this path here you can just double click on it and or click on edit and this will open now click on new and paste your path where you have extracted PHP here click on Okay click on okay and click on okay again now we have successfully installed and set up PHP to test your PHP version press Windows key and type CMD open it and type PHP DV hit enter and as you can see phsp 8.3.3 is installed once PHP is installed and added to environment let's open Visual Studio code and create our first PHP project now let's create a new project I'll just create a new project in desktop click on new folder and let's call this my PHP project right you can create it anywhere you want click on select folder and here as you can see the folder is open and we don't have any files here so let's create some sample PHP code so I have created a simple login page here this is a login form and once you login login.php will be executed now you can pause the video and just quickly type out this code so that you can test if this works or not and this is nothing but just a normal HTML form with username password and when you click on login login.php is called okay and once the login is successful user is shown this page that says welcome this is a simple page for authenticated user so yeah once we have our Pages ready we need to install some extension let's click on extension and search for PHP server and this is the server that you need to install now I already have it installed so I'll just click on uninstall and in your case you will see this install button so click on install and this PHP server will be installed and and once this is installed we can run our project to run it what you can do is double click on this login or HTML login. HTML or any of your start page and you can click on this button here or you can just right click and click on PHP server Ser project and as you can see your project is now running you can test out some code here and see if it works or not and as you can see our PHP file is executed you can go back and this time let's enter a wrong information click on login and as you can see our login. PHP is saying invalid username or password so this is how you can set up phite in vs code now you can see this message here that says serving project you can right click and click on stop server and this time if you reload as you can see nothing will happen because our server is stopped so this is how you can create your Visual Studio code if you have any questions let me know in the comments below
Info
Channel: The Code City
Views: 584
Rating: undefined out of 5
Keywords: create PHP project in visual studio code, create php project in vscode, how to run php in vscode, setup php for visual studio code 2024, php in visual studio code 2024, php in vscode 2024
Id: dXtwRw9zZNo
Channel Id: undefined
Length: 4min 33sec (273 seconds)
Published: Sun Feb 25 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.