Set up docker-compose in PhpStorm 2017.3.2
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)
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
add a comment |
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)
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
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
add a comment |
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)
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
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)
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
php docker docker-compose phpstorm
edited Nov 24 '18 at 12:23
progonkpa
asked Nov 24 '18 at 9:15
progonkpaprogonkpa
85511125
85511125
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
add a comment |
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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