Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated old Project Settings data with new one
Wiki Markup
{align:right}
{html}
<a href="https://twitter.com/share" class="twitter-share-button" data-via="phpstorm">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<span id="fb-root"></span>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<span class="fb-like" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false" style="position:relative;margin-left:-20px;top:-5px;"></span>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<g:plusone size="medium"></g:plusone>
{html}
{align}

Redirect
locationhttps://www.jetbrains.com/help/phpstorm/configuring-remote-interpreters.html
delay2

Include Page
Social Buttons PhpStorm
Social Buttons PhpStorm

 

Note
iconfalse

Using a remote PHP interpreter instead of a local one lets us run our application and PHP-based tools on a production-like environment, be it the real production server or a virtualized one that uses a tool like Vagrant. Speaking of Vagrant, with remote PHP interpreters we can install only PhpStorm on our development machine, and run, debug and unit test our application on the Vagrant machine. In this tutorial, we'll see how we can work with remote PHP interpreters in PhpStorm.

Table of Contents

1. Registering a new PHP interpreter

A remote interpreter can be configured in a similar way as a local one. We can specify the PHP interpreter we want to use in Project File | Settings (or PhpStorm | Preferences for Mac) | Languages & Frameworks | PHP. This can be a local PHP installation or a remote PHP executable. Clicking ... next to the selected interpreter will open a list of registered PHP interpreters. Click the green + to add a new Remote....

...

Once a remote PHP interpreter is registered and configured, we can set up our project to use it during development. Simply select it in the dropdown list in Project Settings | in File | Settings (or PhpStorm | Preferences for Mac) | Languages & Frameworks | PHP.

Once configured, all our Run/Debug configurations will make use of the configured PHP interpreter. Since we just configured a remote PHP interpreter as the one that should be used for our project, the following run configuration will always run on the remote server or Vagrant machine. All paths in Run/Debug Configuration should be local, they'll be automatically mapped to remote server local paths by the IDE.

...

1. Make sure that remote PHP interpreter is configured and selected for current project in Settings/Preferences in File | Settings (or PhpStorm | Preferences for Mac) | Languages & Frameworks | PHP, and Xdebug extension is installed (read more on Xdebug installation).

2. Configure SFTP deployment server that matches Remote Interpreter settings in Settings/Preferences settings in File | Settings (or PhpStorm | Preferences for Mac) | Build, Execution, Deployment | Deployment with proper mappings (if you don't have it configured yet).

...

We can also run PHPUnit tests using remote PHP interpreters. To do so, configure a remote PHP interpreter first. Next, click the green + button in Project Settings | PHP | PHPUnit in File | Settings (or PhpStorm | Preferences for Mac) | Languages & Frameworks | PHP | Test Frameworks and add PHPUnit settings By Remote Interpreter.

...

Local path

Path on the remote server

Web path (URL)

Wiki Markup
{pre}C:\Projects\wordpress-networkmarketing{pre}

Wiki Markup
{pre}/site/wwwroot/wp-content/plugins/jetbrains-networkmarketing{pre}

Wiki Markup
{pre}/wp-content/plugins/jetbrains-networkmarketing{pre}

In the case where multiple folders should be mapped, which is common for frameworks like Symfony2, Zend Framework, Laravel or CakePHP that typically make use of two main folders, we can configure additional mappings:

Local path

Path on the remote server

Web path (URL)

Wiki Markup
{pre}C:\Projects\MyProject\application{pre}

Wiki Markup
{pre}/site/application{pre}

 

Wiki Markup
{pre}C:\Projects\MyProject\public{pre}

Wiki Markup
{pre}/site/wwwroot{pre}

Wiki Markup
{pre}/{pre}

Note the warning shown is because the /application path has no web path specified, which in this setup is perfectly fine.

Note

Note that when folders match multiple relevant mappings, the nearest one is applied.

Wiki Markup
{align:right}
{html}
<a href="https://twitter.com/share" class="twitter-share-button" data-via="phpstorm">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<span id="fb-root"></span>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<span class="fb-like" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false" style="position:relative;margin-left:-20px;top:-5px;"></span>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<g:plusone size="medium"></g:plusone>
{html}
{align}

Include Page
Social Buttons PhpStorm
Social Buttons PhpStorm