Home>Article>Backend Development> Detailed explanation of the steps to configure the PHP development environment with VSCode+PHPstudy
[Related learning recommendations:php graphic tutorial]
Step one: Download and install the VSCode editor
Step 2: Download and install the PHPstudy integrated environment
Step 3: Open PHPstudy and select the environment on the left side of the interface
Step 4: Click More under the PHP running environment on the right and select the appropriate PHP version
Step 5: Click the environment on the left side of PHPstudy, then click Settings in the PHP options on the right side, select the extension component in the pop-up interface, then click the XDebug debugging component, remember what the port listening number is, and finally click Confirm
Step 6: Click the homepage on the left side of PHPstudy, click the WNMP red dot to switch to the appropriate Web server, and then click Start
Step 7: Open the VSCode editor, find the tools and languages for the custom project in the welcome interface, and click to install additional support for PHP
Step 8: Open the VSCode file-> Preferences-> Settings-> Extensions-> Find the PHP plug-in
Step 9: Click on the settings.json files of PHP and PHP IntelliSense plug-in respectively
Step 10: Find the php.exe file path in the phpstudy installation path:
D:/phpstudy_pro/Extensions/php/php7.3.4nts/php.exe
; Copy this path to Find the php.validate.executablePath and php.executablePath attribute values in the json file in one step
## Step 11: Change the php.exe Add the folder path to the environment variable
Step 12: Open cmd and enterphp -v
; if it appears PHP version information means the addition is successful, otherwise add it again
Step 13: Open VSCode and choose to open the WWW folder under the PHPstudy installation path :D:\phpstudy_pro\WWW
, create a new test.php file in the opened folder for testing; then click Start Debugging under Run in the menu bar, and you can see the output in the debugging console below Result; If the debugging console is not displayed, you can open a new terminal in the terminal of the menu bar
Step 14: If the tenth In the three steps, the vscode terminal console is not displayed. You can confirm whether the PHPstudy service is enabled, then open the browser and enter:http://localhost/index.html
in the URL bar. If it is displayed as shown below, Then the same configuration is successful. In the future, the PHP file can be placed in the WWW folder in the PHPstudy installation directory
Configuration successful
Related learning recommendations:php programming(video)
The above is the detailed content of Detailed explanation of the steps to configure the PHP development environment with VSCode+PHPstudy. For more information, please follow other related articles on the PHP Chinese website!