Difference between #51 and #52 of
Yii v2 snippet guide III

Revision #52 has been created by rackycz on Mar 8, 2021, 9:21:44 PM with the memo:

Docker
« previous (#51) next (#53) »

Changes

Title unchanged

Yii v2 snippet guide III

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,yii2,beginer

Content changed

[...]
Note 2: Please keep in mind that xDebug2 and xDebug3 have different settings. Details [here](https://xdebug.org/docs/).

> I spent on this approximately 8 hours. Hopefully someone will enjoy it :-) Sadly, this configuration is not present in docker-compose.yml. It would be soooo handy.

**Docker - Custom php.ini**
 
---
 
Add into section "volumes" this line:
 
 
```
 
- ./myphp.ini:/usr/local/etc/php/conf.d/custom.ini
 
```
 
 
And create file myphp.ini the root of your Yii application. You can enter for example **html_errors=on** and **html_errors=off** to test if the file is loaded. Restart docker and check results using method **phpinfo()** in a PHP file. 
 
 

**How to enter Docker's bash (cli, command line)**
---
[...]
- docker exec -it {NAME} /bin/bash
- ... where {NAME} is your service name. For example:
- docker exec -it yii-advanced_backend_1 /bin/bash

 
 
To findout what Linux is used, you can call **cat /etc/os-release**. (or check the Vagrant chapter for other commands)
 
 
If you want to locate the php.ini, type **php --ini**. Once you find it you can copy it to your yii-folder like this:
 
 
```
 
cp path/to/php.ini /app/myphp.ini
 
```
 
8 0
4 followers
Viewed: 191 065 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Jan 21, 2021
Last updated: a year ago
Update Article

Revisions

View all history