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

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

青灯夜游
Release: 2023-02-21 19:43:56
forward
12428 people have browsed it

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"}
Copy after login
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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template