0

I want to use PhpStorm (in fact IntelliJ with the PHP plugin) to develop my PHP software. I've been using a Linux laptop, with PHP 5.5 and the Oracle library. This has been very difficult to setup and I had a few compatibility problems.

I now have a MacBook where I need to setup the development environment. I want to try and use Docker for development, which should allow me to have different PHP versions with no interaction. But I still want to use PhpStorm, and if possible I don't want to install PHP on the host to keep it clean.

Is there a way to setup PhpStorm to use the PHP interpreter inside a docker machine so I don't need to install PHP on the host?

I'm using this as a guide and now I'm trying to follow this to setup the php interpreter.

1

2 Answers 2

1

PHPStorm by itself does not require PHP installed anywhere.

PHP is required to run or debug scripts and tests, use composer, etc.

The simplest way for OSX host is to use PHPStorm with vagrant. You still can use it with docker as described in PHPStorm with remote interpreter, which still uses the same VM, but may require a bit more effort to configure Dockerfile.

Sign up to request clarification or add additional context in comments.

Comments

1

php:
  build: php
  mem_limit: 7168m
  domainname: php.local
  hostname: php
  restart: always
  container_name: php
  ports:

    - "2222:22" # ssh
    - "8080:80" # http
    - "25:25" #SMTP

  volumes:
    - ~/opt/php:/opt/php/

Step's

  1. Install Docker on your MAC
  2. Use PHP docker image or create one according to your requirement.
  3. Now create a docker-compose and use volumes: to mount your folder which contains's code into the docker
  4. Now you can work with IDE and docker. Without installing PHP on MAC

REF: https://engineering.riotgames.com/news/jenkins-docker-proxies-and-compose

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.