Learn node js, angular, php best practices. A self learning platform to learn web development. Learn modern web development technologies.

June 15, 2019

Vs Code Setup For PHP Development

visual-studio-code-setup-for-php


Internet is a great resource for information, you will be able to find tons of articles online that will guide you to setup visual studio code. If you find any of them useful enough, you can skip reading this post. Otherwise, you can keep going on.

 Visual Studio Code provides easier way to install plugins, so you don't have to waste your time configuring it for this purpose. You need to open extensions option after opening visual studio code which can be seen in the screen shot below.

vs-code-extensions-tab


In the search bar, type "PHP IntelliSense". Click on install button. After it finishes installation. You need to configure this plugin, so that it will be able to communicate directly with the PHP executable file. If this communication is done in a right way, then this plugin will function correctly.

Configuring PHP IntelliSense

In visual studio code, in the menu bar, go to File->Preferences->Settings. In the Settings search bar, type "PHP", you can see similar result as shown below.

vs-code-phpintellisense-plugin-setup


Select PHP IntelliSense option, then click on Edit in Settings.json. You need to add following settings (that are marked inside red rectangle) in that file.

vs-code-phpintellisense-plugin-settings


In the screen shot above, the third option (i.e, php.executablePath ) refers to the location where you have installed php. This may vary for different operating systems. The example shown here is meant for Windows operating system.

That's it, you have successfully configured PHP IntelliSense to speed up PHP development.

Final Words

If you find this post helpful, don't forget to share. Thank you!

No comments:

Post a Comment