Visual Studio 2019 Php

broken image


Visual Studio 2019 Visual Studio Code PHP Tools for Visual Studio transparently integrate into Microsoft Visual Studio, and extend it with the support for PHP language. Visual Studio 2019 Visual Studio Code PHP Tools for Visual Studio transparently integrate into Microsoft Visual Studio, and extend it with the support for PHP language. Code snippets are available for a multitude of languages, including C#, C, Visual Basic, XML, and T-SQL, to name a few. To view all the available installed snippets for a language, open the Code Snippets Manager from the Tools menu (or, press Ctrl+K, Ctrl+B), and choose the language from the drop-down menu at the top. Code snippets can be accessed in the following general ways. On June 6, 2018 Microsoft announced Visual Studio 2019 (version 16). On December 4, 2018 Visual Studio 2019 Preview 1 was released. On January 24, 2019 Visual Studio 2019 Preview 2 was released. On February 13, 2019 Visual Studio 2019 Preview 3 was released. On February 27, 2019 Visual Studio 2019 RC was released. Visual Studio 2019, 2017, 2015, 2013, 2012 & more – Download ISO (Offline Installer) VS2019, VS2017, VS2015, VS2013, VS2012, VS2008, VS2005, VS2003 and VS6 Offline Installers & ISO files for download (All Versions).

PHP Support for Visual Studio 2017 and Visual Studio 2015

Tools of the Trade

Setup for Local Development

Conclusion

PHP Support for Visual Studio 2017 and Visual Studio 2015

Visual Studio is a popular Integrated Development Environment (IDE) provided by Microsoft to manage projects for Windows and the Web. It has built in support for Microsoft products like Visual C++, Visual C#, Visual Basic and Visual Web to name a few. It also supports product extensions so that you can work with additional languages in a familiar environment.

Devsense provides a complete package of PHP Tools that extends the Visual Studio IDE to support the PHP scripting language, currently up to PHP version 5.6 (soon PHP 7 too), HTML, CSS and Javascript.

It also makes use of a built in Web server so that you are not required to set up your own for local development and the xDebug debugger. Visual Studio 2017, 2015, 2013, 2012 and 2010 are all supported, the exception being the express edition which does not support extensions.

In this series I will be using Visual Studio 2015 Community Edition, which is available for free from Microsoft, and PHP Tools version 1.19 which is available for free for a full 30 day evaluation from Devsense.

In this first part of the series I will be looking at the features available, installation, and set up. In the second part I will explore using the IDE with practical examples. In the third part I will demonstrate using the debugging features.

PHP, HTML, CSS and JavaScript can all be written using any simple text editor. This is how it was done long before any IDE's where available and how it is still being done by many freelance developers.

Eventually your projects will become more complex and with that complexity they become harder and harder to manage. An IDE will provide the tools to make you work easier and more productive.

Anyone who knows me, knows that I like to compare programming to the construction industry. Consider building a house. The only tools you really need are a hammer and hand saw. However given the choice I would much prefer to use measuring tapes, circular saws and nailers. These tools allow me to construct in a couple of days what would take months without them.

So, let us take a look at some of these tools available to us using the Visual Studio IDE and PHP Tools extension.

Coding is nothing more than providing a set of instructions in a supported language that can be interpreted. In our case, we are using the PHP scripting language that has its set of rules and particular syntax requirements.

Code highlighting is a feature provide by smart editors to colorize different parts of code so that we can easily, visually identify them.

Code completion is a feature which provides you with options to choose language constructs based on what you are typing. This gives you the ability to only type a few characters and let the editor complete the rest.

These suggestions also include functions, properties and methods from included files which is a real time saver by allowing you to stay in the file you are currently working on.

Code folding is a feature which allows you to shrink and expand code blocks, so that you can hide any code you are not currently working on. It is also a convenient way to provide detailed comments without them taking up a lot of your workspace while coding. Devsense refers to this feature as outlining.

Smart indenting is a feature to help keep your code readable by indenting code contained in blocks. If you have ever tried tracking down an extra closing bracket in code that is not indented, you will instantly understand the benefit of this.

Reference highlighting is a feature that allows you to quickly identify and find code with the same reference. If you need to find all instances of a call to a particular method, this tool will automatically do the search for you.

The task list is an easy way to use comments to indicate tasks that still need to be completed in your code. It will generate a list of all instances where the keyword TODO or PHP Doc @todo is found and present the comment, file and line number. Ptgui pro 11.20 full.

Visual

Error Highlighting

Error highlighting is a feature that will identify and describe syntax errors in your code, making short work of fixing those pesky typo's.

Refactoring

When you want to for instance rename variable, you just do it on some occurrence, then press Ctrl + . and you will see the possibility to rename all the occurrences.

If you do not already have Visual Studio installed, the first step will be to download it from Microsoft and run the installer. Installation is very simple, the installer will automatically download, install and set up the components.

Php

Error Highlighting

Error highlighting is a feature that will identify and describe syntax errors in your code, making short work of fixing those pesky typo's.

Refactoring

When you want to for instance rename variable, you just do it on some occurrence, then press Ctrl + . and you will see the possibility to rename all the occurrences.

If you do not already have Visual Studio installed, the first step will be to download it from Microsoft and run the installer. Installation is very simple, the installer will automatically download, install and set up the components.

This process can take several minutes to complete. Once complete, run Visual Studio so that it can complete the tasks which run during the first initialization. Close Visual Studio so that you can install the PHP Tools extension.

Next you will need to download the latest stable version and run the PHP Tools file from Devsense. The installer will determine which versions of Visual Studio you have installed, select the IDE's you want to extend and click the Install button. Once the installation has completed, run Visual Studio and it will complete the integration.

It is really very simple and you will now have the option to create new packages using PHP.

To develop PHP applications locally, you will need a Web server and xDebug. Once you have written some code, the first time you test it you will be given the option to set up the built in web server or to manually configure the IDE for one you already have installed.

For our purposes, we will use the built in Web server since all you need to do is select this option and launch it. The IDE will take care of downloading and configuring both PHP and xDebug in one simple step.

If you are already a user of Visual Studio, it is a no brainer to use the same IDE for your PHP projects. If you are looking for an IDE, one of the main advantages with this solution is that ability to have support for several languages in one place.

While Visual Studio 2105 Community Edition is absolutely free, the PHP Tools extension is licensed with a fee but you can download it for free from the site to evaluate it at no cost.

The PHP Tools full version cost is comparable to other IDE's which support PHP, so you will need to decide if making a small investment is worth the gains in productivity that professional tools will provide.

Given that Microsoft Visual Studio by itself supports many other languages already, like for instance JavaScript, it may be a good option considering that benefit for Web developers.

In the next installment of this series we will get much more involved in creating a PHP project, adding multiple files and testing our code locally as we develop.

For now, if you liked this article, please share it with other developers interested in this tool. If you have a question, post a comment here.

The Xdebug PHP extension is required to allow PHP Tools to integrate debugging features into Visual Studio.

Choose the Right Xdebug Binaries

Php Tools For Visual Studio 2019 Crack

Choose the version depending on your PHP version, but always 32bit. It is strongly recommended to use the non-thread safe (NTS) version on Windows.

You can also use the tool provided by Xdebug developers: Xdebug Wizard. You can copy and paste your phpinfo output. It will give you the correct version to download.

Copy Xdebug binary to your PHP Extensions Folder

PHP extensions folder is usually located within your PHP runtime, in ext subfolder.

Copy downloaded Xdebug binaries into the PHP extensions folder.

Update PHP Configuration

Edit PHP Configuration file. Its name is usually php.ini, and it is located within your PHP runtime folder.

Add the following lines at the end of your configuration file depending on Xdebug version you have. Change the absolute path for Xdebug so it corresponds to the correct path on your system.

Xdebug 2

Xdebug 3

Notice:

Visual Code Php

  • From PHP 5.3 onwards, you need to use zend_extension and not zend_extension_ts.
  • Xdebug is incompatible with the Zend Optimizer and Zend Studio Debugger extensions. These extensions should be commented out.
  • PHP Tools for Visual Studio has a configuration check feature that can recommend and apply configuration changes depending on your system.

Php Tools For Visual Studio

xdebug.remote_port setting has to be the same as in PHP Tools options (in Visual Studio, Tools | Options | PHP Tools | Advanced). The default value is 9000 (For Xdebug 3 it's 9003) and it is usually enough just to leave it as it is.

Note: nginx server using FastCGI may block port 9000 by default. Change Xdebug port to 9001 both in php.ini and in Visual Studio settings. Note that restarting nginx will not reload php.ini! You will need to restart PHP, or your server.

Verify Installation

To verify your Xdebug installation, follow these steps:

  1. Create a simple PHP file containing the following:

  2. Open the corresponding URL in your browser.

  3. You should see the Xdebug section in the output.

If you do not see the section above in your phpinfo output, there may be something wrong with your PHP configuration or you may need to restart your web server to let PHP update its configuration. If PHP Tools debugging session was started before a configuration change, it is recommended to close it by exiting its systray icon or restarting Visual Studio.





broken image