Xampp+vscode Development of PHP configuration flow

Source: Internet
Author: User
Tags php debug

I. Documents required

1.XAMPP Integration Server (personal use 7.1.7) https://www.apachefriends.org/download.html

2.vscode https://code.visualstudio.com/

3.x-debug (depending on the version of PHP installed, the individual uses PHP 7.1 VC14 TS) https://xdebug.org/download.php

4.vscode Plug-in

Second, the configuration process

1. Install XAMPP to computer, add PHP folder path in environment variable-system variable-path (entire PHP folder instead of Php.exe)

Enter php-v in cmd to check if configuration is successful

2. Copy the downloaded X-debug file (php_xdebug-2.5.1-7.1-vc14.dll) to the Php\ext folder

PS. If you are prompted to "computer lost Php7.dll" When you start Apache in the XAMPP panel, check to see if the downloaded X-debug file name contains nts if you try to change it to another version.

3. Open the php.ini in the PHP directory and add the following lines at the end of the configuration

[Xdebug]

Zend_extension= "E:/program/xampp/php/ext/php_xdebug-2.5.1-7.1-vc14.dll" (change path by itself)

xdebug.remote_enable = 1

Xdebug.remote_autostart = 1

4. Install Vscode, search for PHP debug in the expansion store inside, click Install

5. Click on the Vscode file-preferences-settings (different versions may show different, note look for user settings), add a line of configuration

"Php.validate.executablePath": "E:/program/xampp/php/php.exe",

6. Configure Debug

Jump out of the Launch.json default can

7. Start debugging

8. Open the PHP you want to debug in the browser (not the file path but the address of the server (http://127.0.0.1/test/test.php)), Vscode will hit the point where the break

Finally, 2 Vscode plugins are recommended:

The PHP IntelliSense plugin supports function definition jumps. The PHP7 ext address must be added to the computer's environment variable, Path.

PHP intellisense-crane code hint completion.

Xampp+vscode Development of PHP configuration flow

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.