Lập trình php trên visual studio

     

Visual Studio nguyenminhchau.com is a great editor for PHP development. You get features lượt thích syntax highlighting và bracket matching, IntelliSense (nguyenminhchau.com completion), & snippets out of the box và you can add more functionality through community-created VS nguyenminhchau.com extensions.

Bạn đang xem: Lập trình php trên visual studio

Linting

VS nguyenminhchau.com uses the official PHPhường linter (php -l) for PHP language diagnostics. This allows VS nguyenminhchau.com to lớn stay current with PHPhường linter improvements.

Tip: Using XAMPP? Install the full version of PHPhường in order khổng lồ obtain the development libraries.

There are three web1_settings khổng lồ control the PHP linter:

php.validate.enable: controls whether to enable PHPhường linting at all. Enabled by mặc định.php.validate.executablePath: points lớn the PHP.. executable on disk. Set this if the PHPhường executable is not on the system path.php.validate.run: controls whether the validation is triggered on save (value: "onSave") or on type (value: "onType"). Default is on save sầu.

To change the PHP web1_settings, open your User or Workspace Settings (⌘, (Windows, Linux Ctrl+,)) và type "php" to lớn filter the menu of available web1_settings.

Xem thêm: Thi Thpt Quốc Gia 2019: Đề Thi Thử Toán Thpt 2019 Có Lời Giải Chi Tiết

*

To set the PHPhường executable path, select the Edit in web1_settings.json liên kết under PHPhường. > Validate: Executable Path, which will open your web1_user web1_settings.json file. Add the php.validate.executablePath web1_setting with the path lớn your PHP. installation:

Windows:

"php.validate.executablePath": "c:/php/php.exe"

Linux và macOS:

"php.validate.executablePath": "/usr/bin/php"

Snippets

Visual Studio nguyenminhchau.com includes a phối of comtháng snippets for PHPhường. To access these, hit ⌃Space (Windows, Linux Ctrl+Space) to get a context-specific danh mục.

*

PHP extensions

There are many PHP language extensions available on the VS nguyenminhchau.com Marketplace and more are being created. You can search for PHPhường extensions from within VS nguyenminhchau.com in the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)) then filter the extensions dropdown list by typing "php".

*

Disable built-in PHPhường support

To disable the built-in PHPhường smart completions in favor of suggestions from an installed PHPhường. extension, unkiểm tra PHPhường. > Suggest: Basic, which sets php.suggest.basic lớn false in your web1_settings.json file.

Debugging

PHP.. debugging with XDebug is supported through a PHP. Debug extension. Follow the extension"s instructions for configuring XDebug khổng lồ work with VS nguyenminhchau.com.