Revision #4 has been created by
rackycz on Oct 8, 2025, 12:46:31 PM with the memo:
edit
« previous (#3) next (#5) »
Changes
Title
unchanged
Yii3 - How to start
Category
unchanged
Tutorials
Yii version
unchanged
3.0
Tags
unchanged
Content
changed
[...]
Note:
- Instead of installing local WAMP- or XAMPP-server I will be using Docker.
- Do not forget about a modern IDE like PhpStorm, which comes budled with all you will ever need.
# IntroYii3 - How to start
Yii3 offers more basic applications: Web, Console, API. I will be using the API application:[...]
- https://docs.docker.com/get-started/introduction/get-docker-desktop/
## Running the demo application
You may be surprised that docker-compose.yml is missing in the root. Instead the "make" commands are prepared.[...]
The web will be, from now on, available on URL http://localhost:9080 which is more handy than just ":80" I think.
## Enabling MariaDB (MySQL) and migrations
Now when your project contains MariaDB, you may wanna use it in the code ...
### Installing composer packages
After some time of searching you will discover you need to install these composer packages:[...]
> If you are using PhpStorm, find the small icon "Services" in the left lower corner (looks ca like a cog wheel), find item "Docker-compose: app-api", inside click the "app" service, then "yii3api_php" container and then hit the button "terminal" on the righthand side.
### Setting up composer packages
Follow their documentations. Quick links:[...]
```php
<<?php
declare(strict_types=1);
```
### Create folder for migrations
- src/Migration
When this is done, call "composer du" or "make composer du" and then try "make yii list". You should see the migration commands.
## Creating a migration
Run the command to create a migration:[...]
```
## Running the migrations
Try to run "make yii migrate:up" and you will see error "could not find driver", because file "docker/Dockerfile" does not install the "pdo_mysql" extention. Add it to the where "install-php-extensions" is called.
Then call:
- make down
- make build[...]