


Detailed explanation of how to configure the PHP development environment in vscode
This article will give you a detailed introduction to how to configure the PHP development environment in vscode. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
1. Download XAMPP
XAMPP is an easy-to-install Apache distribution. These include MariaDB, PHP and Perl. Just download and launch the installer.
XAMPP download address
Official website download: https://www.apachefriends.org/zh_cn/download.html
(You may need to access the Internet scientifically. I can’t download it, so the link is here)
Other address for downloading: http://xiazai.zol.com.cn/detail/38 /372445.shtml
(It is recommended to download this, choose local download-Telecom channel or China Unicom channel)
After downloading, the PHP version number is the following one, which will be used later
Install XAMPP
All the way to NEXT, it is best not to choose the C drive for the installation address. The author installed it in English Version.
Installation successful
Enable according to requirements. If I write PHP, I choose to enable Apache.
Add system variables
Add the path to the folder where PHP.exe is located (the author’s is “D:\XAMPP\php") is added to Environment Variables-System Variables-Path (you can find it by directly searching for system variables in the search box).
Enter php -v in cmd to check whether the configuration is successful
Configuration is successful
2. Download the xdebug plug-in
Download address: https://xdebug.org/download
What PHP version can you download? In the README in XAMPP, see
(The author’s is PHP 7.4.0, and it is the Thread safe version, which corresponds to the version with TS, and the corresponding version without nts downloaded Version, file name: php_xdebug-2.9.7-7.4-vc15-x86_64.dll)
##Add configuration
Copy the downloaded x-debug file (php_xdebug-2.9.7-7.4-vc15-x86_64.dll) to the php\ext folder Use Notepad to modify the php.ini file, in Add a few lines of configuration information to the end of the file and save it.
[xdebug] zend_extension="D:/xampp/php/ext/php_xdebug-2.9.7-7.4-vc15-x86_64"//这个地址以及文件名一定要正确 xdebug.remote_enable = 1 xdebug.remote_autostart = 1
3. Download and install VSCode
##Download address: https://code.visualstudio.com/Install the debugging plug-in in VSCode1. Click the extension bar, enter PHP, and select PHP Debug to install.
Recommended study: "
" 2. Click VSCode's File-Preferences-Settings (different versions may display Different, pay attention to search for user settings), find php in the extension in the settings, click setting.json to add the following line of configuration:
"php.validate.executablePath": "D:/xampp/php/php.exe", //地址是php.exe文件所在的位置
3. Configure Debug
The launch.json that pops out is the default and does not need to be changed.
4. Then simply debug and verify whether the configuration is successful.
Note that you must open a folder to successfully set breakpoint debugging. A single file is invalid. You can choose D:/xampp/php/www<?php
$a = 'hello world';
echo $a;
?>
5. Open the php to be debugged in the browser (not the file path but the address of the server (http://localhost:3000/hello.php)), VSCode will hit the Breakpoint location.
6. Finally, it is recommended to install this plug-in: PHP Server
You can choose to right-click PHP Server: Serve project and jump directly to the browser
7. Running results
For more programming-related knowledge, please visit: Programming Video! !
The above is the detailed content of Detailed explanation of how to configure the PHP development environment in vscode. For more information, please follow other related articles on the PHP Chinese website!

VisualStudio is suitable for large projects, VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive IDE functions, supports multiple languages, integrated debugging and testing tools. 2.VSCode is a lightweight editor that supports multiple languages through extension, has a simple interface and fast startup.

VisualStudio is a powerful IDE developed by Microsoft, supporting multiple programming languages and platforms. Its core advantages include: 1. Intelligent code prompts and debugging functions, 2. Integrated development, debugging, testing and version control, 3. Extended functions through plug-ins, 4. Provide performance optimization and best practice tools to help developers improve efficiency and code quality.

The differences in pricing, licensing and availability of VisualStudio and VSCode are as follows: 1. Pricing: VSCode is completely free, while VisualStudio offers free community and paid enterprise versions. 2. License: VSCode uses a flexible MIT license, and the license of VisualStudio varies according to the version. 3. Usability: VSCode is supported across platforms, while VisualStudio performs best on Windows.

VisualStudio supports the entire process from code writing to production deployment. 1) Code writing: Provides intelligent code completion and reconstruction functions. 2) Debugging and testing: Integrate powerful debugging tools and unit testing framework. 3) Version control: seamlessly integrate with Git to simplify code management. 4) Deployment and Release: Supports multiple deployment options to simplify the application release process.

VisualStudio offers three license types: Community, Professional and Enterprise. The Community Edition is free, suitable for individual developers and small teams; the Professional Edition is annually subscribed, suitable for professional developers who need more functions; the Enterprise Edition is the highest price, suitable for large teams and enterprises. When selecting a license, project size, budget and teamwork needs should be considered.

VisualStudio is suitable for large-scale project development, while VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive development tools, such as integrated debugger, version control and testing tools. 2.VSCode is known for its scalability, cross-platform and fast launch, and is suitable for fast editing and small project development.

VisualStudio is suitable for large projects and Windows development, while VSCode is suitable for cross-platform and small projects. 1. VisualStudio provides a full-featured IDE, supports .NET framework and powerful debugging tools. 2.VSCode is a lightweight editor that emphasizes flexibility and extensibility, and is suitable for various development scenarios.

When choosing VisualStudio, the free version is suitable for individual developers and small teams, and the paid version is suitable for large enterprises and users who need advanced features. 1. The free CommunityEdition provides basic development tools for individuals and small teams. 2. Paid Professional and Enterprise Editions provide advanced features and support for business environments and large teams.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version
