【问题标题】:Getting started with PhpStorm开始使用 PhpStorm
【发布时间】:2020-05-30 15:30:26
【问题描述】:

我正在使用link 设置 PhpStorm Workshop。

但是,当我开始设置 docker-compose.yml 文件的步骤时,我不断收到错误消息。

D:\xampp\htdocs\phpstormworkshop>
docker-compose up
ERROR: yaml.parser.ParserError: while parsing a block mapping
in ".\docker-compose.yml", line 18, column 5
expected <block end>, but found '<block sequence start>'
in ".\docker-compose.yml", line 25, column 7

该文件是 PhpStorm 附带的文件,我所做的只是取消注释 Windows 路径。

version: '2'
services:
  debug:
    image: phpstorm/php-71-apache-xdebug
    ports:
     - "8081:80"
    volumes:
      - ./workshop/07_Debugging:/var/www/html
    environment:
        #For Windows and macOS, replace the line below with `host.docker.internal`, which will automatically resolve to the internal address of the host Docker is running on.
        #For Linux, replace the line below with your hostname, which you can obtain by executing `hostname` in Terminal.
        XDEBUG_CONFIG: remote_host=host.docker.internal

        #For macOS, if you use a local Homebrew php-fpm installation, port `9000` (which is the default debugging port) may become occupied. PhpStorm will remain silent on starting listening for incoming connections. If this is the case, in the Settings | Languages & Frameworks | PHP | Debug, set the Debug port to 9001, and use the following configuration line instead.

        #XDEBUG_CONFIG: remote_host=host.docker.internal, remote_port=9001
  sftp:
    image: phpstorm/sftp-server
    ports:
      - "2022:22"
    volumes:
  #   Uncomment for Windows
       - C:/temp:/home/jetbrains/upload
  #   Uncomment for macOS/Linux
      - /tmp:/home/jetbrains/upload
    command: jetbrains:jetbrains:1001
  mysql:
      image: phpstorm/mysql
      ports:
        - "33056:3306"
      volumes:
        - ./data:/var/lib/mysql

任何想法为什么我可能会收到此错误?一直无法在网上找到任何东西。

【问题讨论】:

    标签: php docker-compose phpstorm


    【解决方案1】:

    您应该只取消注释其中的一行:

      #   Uncomment for Windows
      #     - C:/temp:/home/jetbrains/upload
      #   Uncomment for macOS/Linux
          - /tmp:/home/jetbrains/upload
    

    或者(如果您使用 Windows)

      #   Uncomment for Windows
           - C:/temp:/home/jetbrains/upload
      #   Uncomment for macOS/Linux
      #    - /tmp:/home/jetbrains/upload
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-17
      • 1970-01-01
      • 2014-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多