Home >Development Tools >VSCode >How to run php in vscode? (Environment configuration tutorial)

How to run php in vscode? (Environment configuration tutorial)

青灯夜游
青灯夜游forward
2023-01-14 19:35:0712447browse

How to run php in vscode? The following article will introduce to you how to configure PHP configuration in vscode. I hope it will be helpful to you!

How to run php in vscode? (Environment configuration tutorial)

Use vscode to run php

##一, Install the extension

We first open vscode

and then go to the place where the extension is installed

How to run php in vscode? (Environment configuration tutorial)

Here we need Two extensions, one is

php server, the other is php debug [Recommended learning: vscode tutorial, Programming teaching]

How to run php in vscode? (Environment configuration tutorial)

Click to install

2. Configure the extension

Let’s create a new php file first

How to run php in vscode? (Environment configuration tutorial)

Click to change the file

Then File-->Preferences-->Settings

How to run php in vscode? (Environment configuration tutorial)

How to run php in vscode? (Environment configuration tutorial) Set up the php exe

How to run php in vscode? (Environment configuration tutorial)
How to run php in vscode? (Environment configuration tutorial) Just add these. But please note that it is the path of your php file. The one here is mine.

{
    "php.validate.executablePath": "php路径/php.exe",    "php.debug.executablePath": "php路径/php.exe",    "phpserver.phpConfigPath": "php路径/php.ini",    "phpserver.phpPath": "php路径/php.exe"}
Let’s test whether it can be used.

How to run php in vscode? (Environment configuration tutorial)
How to run php in vscode? (Environment configuration tutorial) Access successful!

Sometimes it runs, but the page does not display the information you want. You can save the file with ctrl s and run it again.

This article ends here, thank you for your patience in reading.

For more knowledge about VSCode, please visit:

vscode tutorial! !

The above is the detailed content of How to run php in vscode? (Environment configuration tutorial). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete