Difference between #48 and #49 of
Yii v2 snippet guide III

Revision #49 has been created by rackycz on Mar 8, 2021, 9:06:39 PM with the memo:

Docker
« previous (#48) next (#50) »

Changes

Title unchanged

Yii v2 snippet guide III

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,yii2,beginer

Content changed

[...]
- Current IP: hostname -I

In "scotch/box" I do not use PhpMyAdmin , but [Adminer](https://www.adminer.org/en). It is one simple PHP script and it will run without any installations.
Just copy the adminer.php script to your docroot and access it via browser. Use the same login as in configurafion of Yii. Server will be localhost.

**Running Yii project in Docker (
now without xDebugUpdate: xDebug added below!)**
---
[...]
*I was not able to use xDebug. It just does not work now. I will update as soon as I find out.*

**Enabling xDebug in Docker, yii demo application**
 
---
 
 
Just add section **environmenr** to docker-compose.yml like this:
 
 
```
 
services:
 
 
  frontend:
 
    build: frontend
 
    ports:
 
      - 20080:80
 
    volumes:
 
      # Re-use local composer cache via host-volume
 
      - ~/.composer-docker/cache:/root/.composer/cache:delegated
 
      # Mount source-code for development
 
      - ./:/app
 
    environment:
 
      PHP_ENABLE_XDEBUG: 1
 
      XDEBUG_CONFIG: "client_port=9000 start_with_request=yes idekey=netbeans-xdebug log_level=1 log=/app/xdebug.log discover_client_host=1"
 
      XDEBUG_MODE: "develop,debug"
 
```
 
 
Note: You can/must specify the **idekey** and **client_port** based on your IDE settings. Plus your Yii project must be well configured in the IDE as well. In NetBeans make sure that "Project URL" and "index file" are correct in "Properties/Run Configuration" (right click the project)
 
 
Note 2: Please keep in mind that xDebug2 and xDebug3 have different settings. Details [here](https://xdebug.org/docs/).
 
 
 
**How to enter Docker's bash (cli, command line)**
---

Navigate in command line to the folder of your docker-project and run command:
- docker ps
- This will list all services you defined in docker-compose.yml
[...]
8 0
4 followers
Viewed: 164 753 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Jan 21, 2021
Last updated: 8 months ago
Update Article

Revisions

View all history