Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use PHP with Visual Studio

First let me say I've never used PHP but I'm looking to learn it, so my question is this how do you use PHP within Visual Studio Ultimate? is it similar to how you declare JQuery i.e

$(document).ready(function ()  {      // Code goes here?   }); 

I've done multiple searches on Google, but I don't get the answer I'm looking for.

Or do I need a complete different bit of software to use it?

like image 385
Code Ratchet Avatar asked May 10 '12 07:05

Code Ratchet


People also ask

Can I use PHP in Visual Studio?

PHP in Visual Studio Code. Visual Studio Code is a great editor for PHP development. You get features like syntax highlighting and bracket matching, IntelliSense (code completion), and snippets out of the box and you can add more functionality through community-created VS Code extensions.

How do I run PHP in Visual Studio?

You can install an add-on with the extension manager, PHP Tools for Visual Studio. If you want to install it inside VS, go to Tools > Extension Manager > Online Gallery > Search for PHP where you will find PHP Tools (the link above) for Visual Studio.

How do I add PHP code to Visual Studio?

Type “php” or “intelephense” to locate the PHP Intelephense extension. Click on the Install button to install and enable the extension. Once installation is complete, Intelephense's official documentation recommends that you disable the built-in PHP Language Features extension that comes with VS Code.

Can Visual Studio 2019 use PHP?

PHP Tools for Visual Studio transparently integrate into Microsoft Visual Studio, and extend it with the support for PHP language. The extension is focused on developer productivity respecting conventions.


Video Answer


1 Answers

By default VS is not made to run PHP, but you can do it with extensions:

You can install an add-on with the extension manager, PHP Tools for Visual Studio.

If you want to install it inside VS, go to Tools > Extension Manager > Online Gallery > Search for PHP where you will find PHP Tools (the link above) for Visual Studio. Also you have VS.Php for Visual Studio. Both are not free.

You have also a cool PHP compiler called Phalanger: Phalanger PHP Compiler

If I'm not mistaken, the code you wrote above is JavaScript (jQuery) and not PHP.

If you want cool standalone IDE's for PHP: (Free)

  • Netbeans: https://netbeans.org/downloads/start.html?platform=windows&lang=en&option=php
  • Eclipse: http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliosr
like image 129
Gabriel Avatar answered Oct 02 '22 04:10

Gabriel