
Working with Docker in PhpStorm Running the Docker from PhpStormĪs all the tools are installed, and the integration is configured, the recently created Start Docker Run/Debug Configuration can be launched:
#Phpstorm mac download#
You can download entire project used in this demo or separate config files ( nf, Dockerfile) which then need to be placed in the project root folder. We're making some significant configuration in those Dockerfile and Apache configuration file, so you're recommended to have a look at them. We've also created an index.php file with phpinfo() to be deployed to the Docker container. Apply the Run/Debug Configuration and close the dialog.Īt this step it's important to note that that there are many ways to create/configure Docker containers and VM images, and we'd recommend to always refer to the Docker documentation on the official web site.įor the purposes of this tutorial we're using Dockerfile and Apache configuration file.

In addition, we can configure links, volume bindings, environment variables, and much more. At this point we are interested in exposing port 80 of the container to be available from our local machine, so we should configure a port binding for that ( Container port: 80, Protocol: tcp, Host IP: empty, Host port: 8080): Provide all the necessary parameters and configurations on the Container tab. In our case we've provided Run/Debug Configuration Name ( Start Docker in our case), selected the server ( Docker), selected the Deployment method to be Dockerfile, provided Image tag ( mysite) and Container name ( Docker_Xdebug): Provide all the necessary parameters on the Deployment tab. Then, create a Docker Deployment configuration with a + button:
#Phpstorm mac for mac os x#
You should provide the configuration name ( Docker in our case), API URL ( tcp://localhost:2375 for Windows and for Mac OS X if using PhpStorm older than 2017.1, unix:///var/run/docker.sock for Mac OS X and Linux).

Note: Since PhpStorm 2017.1 you can connect via Unix socket directly.
#Phpstorm mac install#
#Phpstorm mac code#
Like this, you can write clean, error-free code that is very easy to maintain. You can take control of your base code with PhpStorm, thanks to the hundreds of inspections that are in charge of checking the code while you write it, analyzing your project as a whole. Its duplicate code detection system will make your life easier, and the refactorings will let you change names, introduce variables, constants, and fields or move fixed members around comfortably.

It also provides codifying style support and PHPDoc, Code Sniffer, or PHAR support. What's more, it's perfectly compatible with other frameworks such as Symfony, Laravel, Drupal, WordPress, Zend Framework, and Magento, among many others.Īmong its main features are code autocompletion, variable names, or PHP keywords. This tool has many features that will make your life easier. PhpStorm is a very comprehensive integrated development environment that provides an editor for PHP, HTML, and JavaScript with real-time code analysis, error prevention, and automatic refactorings for Java and PHP code.
