php - PhpStorm not publishing to Docker

I have a fresh install of PhpStorm 2020.1, Docker Desktop 2.3.0.3 (45519) on Windows 10 (1909).
I am trying to follow the instructions on how to start up a dev environment.
I have followed the instructions that come with PhpStorm and it all seems to startup, but I can not open the example pageHelloWorld.php
Below is my setup, can someone offer some advice on what I am missing.
The docker-compose.yml that is shown above is from "PHPStorm Workshop Project", it is not something that I have created. PHPStorm Workshop Project
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
=====================
As LazyOne pointed out, I miss read the port number hosted page, I should have tried 8081. This just shows a 404 though.
Looking into the docker images I can see...
Image: phpstorm/php-71-apache-xdebug
Log:
[Mon Jun 29 09:38:13.391958 2020] [php7:error] [pid 17] [client 172.19.0.1:38860] script '/var/www/html/HelloWorld.php' not found or unable to stat
172.19.0.1 - - [29/Jun/2020:09:38:13 +0000] "GET /HelloWorld.php HTTP/1.1" 404 490 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
Image: phpstorm/mysql
Log:
[Entrypoint] MySQL Docker Image 8.0.20-1.1.16
[Entrypoint] Starting MySQL 8.0.20-1.1.16
2020-06-29T09:39:55.936014Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20) starting as process 1
2020-06-29T09:39:55.966003Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-06-29T09:39:56.460720Z 1 [Warning] [MY-012579] [InnoDB] fallocate(16, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.473039Z 1 [Warning] [MY-012579] [InnoDB] fallocate(17, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.496812Z 1 [Warning] [MY-012579] [InnoDB] fallocate(18, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.518401Z 1 [Warning] [MY-012579] [InnoDB] fallocate(19, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.532661Z 1 [Warning] [MY-012579] [InnoDB] fallocate(20, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.551602Z 1 [Warning] [MY-012579] [InnoDB] fallocate(21, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.565370Z 1 [Warning] [MY-012579] [InnoDB] fallocate(22, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.581883Z 1 [Warning] [MY-012579] [InnoDB] fallocate(23, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.597827Z 1 [Warning] [MY-012579] [InnoDB] fallocate(24, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.615128Z 1 [Warning] [MY-012579] [InnoDB] fallocate(25, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
2020-06-29T09:39:56.654877Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-06-29T09:39:56.887730Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
2020-06-29T09:39:56.986555Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-06-29T09:39:57.004613Z 0 [ERROR] [MY-010270] [Server] Can't start server : Bind on unix socket: Input/output error
2020-06-29T09:39:57.005010Z 0 [ERROR] [MY-010258] [Server] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2020-06-29T09:39:57.005476Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-06-29T09:39:58.254400Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20) MySQL Community Server - GPL.
I'm not aware of anything else running on port 22.
Answer
Solution:
Accordingly to your screenshots anddocker-compose.yml
file content:
You should use
localhost:8081
instead of justlocalhost
in your browser.You should move your HelloWorld.php file into
/workshop/07_Debugging
folder as this is the folder that is getting mapped/accessible inside the container. Your project root folder where HelloWorld.php is currently located is outside of that "accessible/mapped" path.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: a non-numeric value encountered
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.