Set up docker-compose in PhpStorm 2017.3.2












0















I created a Docker image that bundles PHP (with Apache), Xdebug and PHPUnit which I can start with docker-compose in the terminal.



version: '3'

services:
php-apache-xdebug-phpunit:
image: php-apache-xdebug-phpunit:7.2
ports:
- "80:80"
volumes:
- ./src:/var/www/html
restart: always


I want to use the PhpStorm integration with docker-compose but when I configure the CLI interpreter, I get two errors (screenshot):




  • BadRequestException -> invalid environment variable (I think an empty value should be possible actually)

  • PHP version: not installed (it's partially visible in the screenshot)


PhpStorm docker-compose config error



The Dockerfile for completeness sake:



FROM php:7.2-apache-stretch

##########
# XDebug #
##########
# Install
RUN pecl install xdebug-2.6.1 && docker-php-ext-enable xdebug
# Configure
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so"' >> /usr/local/etc/php/php.ini
RUN echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.idekey="PHPSTORM"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

###########
# PHPUnit #
###########
RUN apt-get update
RUN apt-get install wget
RUN wget https://phar.phpunit.de/phpunit-7.4.phar
RUN chmod +x phpunit-7.4.phar
RUN mv phpunit-7.4.phar /usr/local/bin/phpunit
RUN phpunit --version

###################
# PHP Codesniffer #
###################
RUN curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
RUN mv phpcs.phar /usr/local/bin/phpcs
RUN chmod +x /usr/local/bin/phpcs









share|improve this question




















  • 1





    Check this comment: youtrack.jetbrains.com/issue/WI-36951#comment=27-2267313

    – LazyOne
    Nov 25 '18 at 13:37











  • That worked! When you configure PHP remote interpreter with docker-compose, you can add environment variables (which I did not) following 3 dots, you can uncheck "Include parent environment variables" checkbox which included a lot of junk by default.

    – progonkpa
    Dec 1 '18 at 14:37
















0















I created a Docker image that bundles PHP (with Apache), Xdebug and PHPUnit which I can start with docker-compose in the terminal.



version: '3'

services:
php-apache-xdebug-phpunit:
image: php-apache-xdebug-phpunit:7.2
ports:
- "80:80"
volumes:
- ./src:/var/www/html
restart: always


I want to use the PhpStorm integration with docker-compose but when I configure the CLI interpreter, I get two errors (screenshot):




  • BadRequestException -> invalid environment variable (I think an empty value should be possible actually)

  • PHP version: not installed (it's partially visible in the screenshot)


PhpStorm docker-compose config error



The Dockerfile for completeness sake:



FROM php:7.2-apache-stretch

##########
# XDebug #
##########
# Install
RUN pecl install xdebug-2.6.1 && docker-php-ext-enable xdebug
# Configure
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so"' >> /usr/local/etc/php/php.ini
RUN echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.idekey="PHPSTORM"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

###########
# PHPUnit #
###########
RUN apt-get update
RUN apt-get install wget
RUN wget https://phar.phpunit.de/phpunit-7.4.phar
RUN chmod +x phpunit-7.4.phar
RUN mv phpunit-7.4.phar /usr/local/bin/phpunit
RUN phpunit --version

###################
# PHP Codesniffer #
###################
RUN curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
RUN mv phpcs.phar /usr/local/bin/phpcs
RUN chmod +x /usr/local/bin/phpcs









share|improve this question




















  • 1





    Check this comment: youtrack.jetbrains.com/issue/WI-36951#comment=27-2267313

    – LazyOne
    Nov 25 '18 at 13:37











  • That worked! When you configure PHP remote interpreter with docker-compose, you can add environment variables (which I did not) following 3 dots, you can uncheck "Include parent environment variables" checkbox which included a lot of junk by default.

    – progonkpa
    Dec 1 '18 at 14:37














0












0








0








I created a Docker image that bundles PHP (with Apache), Xdebug and PHPUnit which I can start with docker-compose in the terminal.



version: '3'

services:
php-apache-xdebug-phpunit:
image: php-apache-xdebug-phpunit:7.2
ports:
- "80:80"
volumes:
- ./src:/var/www/html
restart: always


I want to use the PhpStorm integration with docker-compose but when I configure the CLI interpreter, I get two errors (screenshot):




  • BadRequestException -> invalid environment variable (I think an empty value should be possible actually)

  • PHP version: not installed (it's partially visible in the screenshot)


PhpStorm docker-compose config error



The Dockerfile for completeness sake:



FROM php:7.2-apache-stretch

##########
# XDebug #
##########
# Install
RUN pecl install xdebug-2.6.1 && docker-php-ext-enable xdebug
# Configure
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so"' >> /usr/local/etc/php/php.ini
RUN echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.idekey="PHPSTORM"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

###########
# PHPUnit #
###########
RUN apt-get update
RUN apt-get install wget
RUN wget https://phar.phpunit.de/phpunit-7.4.phar
RUN chmod +x phpunit-7.4.phar
RUN mv phpunit-7.4.phar /usr/local/bin/phpunit
RUN phpunit --version

###################
# PHP Codesniffer #
###################
RUN curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
RUN mv phpcs.phar /usr/local/bin/phpcs
RUN chmod +x /usr/local/bin/phpcs









share|improve this question
















I created a Docker image that bundles PHP (with Apache), Xdebug and PHPUnit which I can start with docker-compose in the terminal.



version: '3'

services:
php-apache-xdebug-phpunit:
image: php-apache-xdebug-phpunit:7.2
ports:
- "80:80"
volumes:
- ./src:/var/www/html
restart: always


I want to use the PhpStorm integration with docker-compose but when I configure the CLI interpreter, I get two errors (screenshot):




  • BadRequestException -> invalid environment variable (I think an empty value should be possible actually)

  • PHP version: not installed (it's partially visible in the screenshot)


PhpStorm docker-compose config error



The Dockerfile for completeness sake:



FROM php:7.2-apache-stretch

##########
# XDebug #
##########
# Install
RUN pecl install xdebug-2.6.1 && docker-php-ext-enable xdebug
# Configure
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so"' >> /usr/local/etc/php/php.ini
RUN echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.idekey="PHPSTORM"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

###########
# PHPUnit #
###########
RUN apt-get update
RUN apt-get install wget
RUN wget https://phar.phpunit.de/phpunit-7.4.phar
RUN chmod +x phpunit-7.4.phar
RUN mv phpunit-7.4.phar /usr/local/bin/phpunit
RUN phpunit --version

###################
# PHP Codesniffer #
###################
RUN curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
RUN mv phpcs.phar /usr/local/bin/phpcs
RUN chmod +x /usr/local/bin/phpcs






php docker docker-compose phpstorm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 '18 at 12:23







progonkpa

















asked Nov 24 '18 at 9:15









progonkpaprogonkpa

88011126




88011126








  • 1





    Check this comment: youtrack.jetbrains.com/issue/WI-36951#comment=27-2267313

    – LazyOne
    Nov 25 '18 at 13:37











  • That worked! When you configure PHP remote interpreter with docker-compose, you can add environment variables (which I did not) following 3 dots, you can uncheck "Include parent environment variables" checkbox which included a lot of junk by default.

    – progonkpa
    Dec 1 '18 at 14:37














  • 1





    Check this comment: youtrack.jetbrains.com/issue/WI-36951#comment=27-2267313

    – LazyOne
    Nov 25 '18 at 13:37











  • That worked! When you configure PHP remote interpreter with docker-compose, you can add environment variables (which I did not) following 3 dots, you can uncheck "Include parent environment variables" checkbox which included a lot of junk by default.

    – progonkpa
    Dec 1 '18 at 14:37








1




1





Check this comment: youtrack.jetbrains.com/issue/WI-36951#comment=27-2267313

– LazyOne
Nov 25 '18 at 13:37





Check this comment: youtrack.jetbrains.com/issue/WI-36951#comment=27-2267313

– LazyOne
Nov 25 '18 at 13:37













That worked! When you configure PHP remote interpreter with docker-compose, you can add environment variables (which I did not) following 3 dots, you can uncheck "Include parent environment variables" checkbox which included a lot of junk by default.

– progonkpa
Dec 1 '18 at 14:37





That worked! When you configure PHP remote interpreter with docker-compose, you can add environment variables (which I did not) following 3 dots, you can uncheck "Include parent environment variables" checkbox which included a lot of junk by default.

– progonkpa
Dec 1 '18 at 14:37












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53456760%2fset-up-docker-compose-in-phpstorm-2017-3-2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53456760%2fset-up-docker-compose-in-phpstorm-2017-3-2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'