zoukankan      html  css  js  c++  java
  • Atitit vscode 调试php vscode使用法 目录 1. 直接debug没反应,或者打开扩展列表 1 2. 调试配置法 1 2.1. Debug》》Add cfg php 1 2.2.

    Atitit vscode 调试php vscode使用法

    目录
    1. 直接debug没反应,或者打开扩展列表    1
    2. 调试配置法    1
    2.1. Debug》》Add cfg php    1
    2.2. Xdebug 和直接执行调试    1
    2.3. 增加runtimeExecutable    1
    3. PHP extensions    2
    4. 问题解决法    4
    4.1. spawn php ENOENT" In VS Code    4
    5. 格式化    5
    6. 重构    5
    6.1. 改变变量名    5


    1.直接debug没反应,或者打开扩展列表
    增加调试配置


    2.调试配置法
    2.1.Debug》》Add cfg php


    2.2.Xdebug 和直接执行调试
    选择: "Launch currently open script",

    2.3.增加runtimeExecutable
    Zengjia
        "runtimeExecutable": "C:/wamp/bin/php/php5.6.31/php.exe",
    Launch.json

    3.PHP extensions
    There are many PHP language extensions available on the VS Code Marketplace and more are being created. You can search for PHP extensions from within VS Code in the Extensions view (Ctrl+Shift+X) then filter the extensions drop-down list by typing 'php'.


    Prettier - Code form...
    4.4M
    esbenp
    Code formatter using prettier


    Code Runner
    2.9M
    formulahendry
    Run C, C++, Java, JS, PHP, Python, Perl, Ruby, Go...


    PHP IntelliSense
    2.9M
    felixfbecker
    Advanced Autocompletion and Refactoring support f...


    HTML CSS Support
    2.4M
    ecmel
    CSS support for HTML documents

    Tip: The extensions shown above are dynamically queried. Click on an extension tile above to read the description and reviews to decide which extension is best for you. See more in the Marketplac

    I found what's the problem. The extension uses the global PATH for php, and if you don't have php in the PATH you have to define it in the extension settings: "runtimeExecutable : mypathphp.exe"

    4.问题解决法
    4.1.spawn php ENOENT" In VS Code
    Zengjia
        "runtimeExecutable": "C:/wamp/bin/php/php5.6.31/php.exe",
    Launch.json

    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [

            {
                "name": "Listen for XDebug",
                "type": "php",
                "request": "launch",
                "port": 9000
            },
            {
                "name": "Launch currently open script",
                "type": "php",
                "request": "launch",
                "program": "${file}",
                "runtimeExecutable": "C:/wamp/bin/php/php5.6.31/php.exe",
                "cwd": "${fileDirname}",
                "port": 9000
            }
        ]
    }


    5.格式化

    Useing:: rignt key>>format


    ile>Preferences>Settings
    from the window that comes when u choose settings, you need to search for "Edit in settings.json" click on that and over there you need to specify your php.exe file path
    mine looks like this
    {
     "phpfmt.php_bin": ""C:\Program Files\php\php.exe"",
    }

    或者sarch phpfmt.php_bin。。Then type in path then ok...

    6.重构
    6.1.改变变量名
    Rightkey 》》change al occurence

  • 相关阅读:
    有几种不同类型的自动代理?
    使用 Spring 通过什么方式访问 Hibernate?
    单片,SOA 和微服务架构有什么区别?
    如何给 Spring 容器提供配置元数据?
    在 Spring AOP 中,关注点和横切关注的区别是什么?
    Java Concurrency API 中的 Lock 接口(Lock interface) 是什么?对比同步它有什么优势?
    移动文件用哪个命令?改名用哪个命令?
    synchronized 的作用?
    “a==b”和”a.equals(b)”有什么区别?
    什么是 Spring beans?
  • 原文地址:https://www.cnblogs.com/attilax/p/15197003.html
Copyright © 2011-2022 走看看