This is a must follow procedure, otherwise your PHP file will not be executed by the Apache Server. You can name it as you wish, but make sure you save it with the “.php” extension. Or, you can click the new file icon:Ĭreate new PHP file in Visual Studio Code To create a new file, Right Click in the “Explorer” section of Visual Studio Code (inside the folder) and hit “New File”. Now, the folder is linked and we can access it from Visual Studio Code. We do that by following these steps: File -> Open Folder ->. PHP in Visual Studio Codeįirst, we need to locate our project folder and open it in Visual Studio Code. With the project folder created, we now open our code editor, which is (you’ve guessed it ? Visual Studio Code. I have named mine: “PHPinVisualStudioCode”. So, Right Click -> New -> Folder, and name your new folder. Once, you find the htdocs folder, you will need to create a new folder there. Usually, if you have installed XAMPP by its default settings, you will find “htdocs” folder in the following path: C:\xampp\htdocsĪgain, your’s might be in a different location. Preparing to Startįirst, we need to find the “htdocs” folder in the XAMPP installation (we use XAMPP, as our PHP environment). I always use PHP in Visual Studio Code, so it is best if you use Visual Studio Code, as your coding editor. In this tutorial you will start your first PHP project.
0 Comments
Leave a Reply. |