PHPackages                             ale10257/yii2-app-basic-with-env-settings - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ale10257/yii2-app-basic-with-env-settings

ActiveProject[Framework](/categories/framework)

ale10257/yii2-app-basic-with-env-settings
=========================================

Yii 2 Basic Project Template with environment settings

2.0.16(7y ago)06BSD-3-ClausePHPPHP &gt;=5.4.0

Since Dec 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ale10257/yii2-app-basic)[ Packagist](https://packagist.org/packages/ale10257/yii2-app-basic-with-env-settings)[ Docs](http://www.yiiframework.com/)[ RSS](/packages/ale10257-yii2-app-basic-with-env-settings/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (9)Versions (19)Used By (0)

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

Yii 2 Basic Project Template with environment settings
======================================================

[](#yii-2-basic-project-template-with-environment-settings)

Yii 2 Basic Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for rapidly creating small projects.

Why .env?
---------

[](#why-env)

**You should never store sensitive credentials in your code**. Storing [configuration in the environment](http://www.12factor.net/config) is one of the tenets of a [twelve-factor app](http://www.12factor.net/). Anything that is likely to change between deployment environments – such as database credentials or credentials for 3rd party services – should be extracted from the code into environment variables.

Basically, a `.env` file is an easy way to load custom configuration variables that your application needs without having to modify .htaccess files or Apache/nginx virtual hosts. This means you won't have to edit any files outside the project, and all the environment variables are always set no matter how you run your project - Apache, Nginx, CLI, and even PHP 5.4's built-in webserver. It's WAY easier than all the other ways you know of to set environment variables, and you're going to love it!

- NO editing virtual hosts in Apache or Nginx
- NO adding `php_value` flags to .htaccess files
- EASY portability and sharing of required ENV values
- COMPATIBLE with PHP's built-in web server and CLI runner

[More](https://github.com/vlucas/phpdotenv)

**Install**

```
composer create-project --prefer-dist --stability=dev ale10257/yii2-app-basic-with-env-settings .

```

**After install**

```
cd your/project
cp example.env .env

```

Edit your settings in .env file

```
YII_DEBUG=true
YII_ENV='dev'
DB_HOST='localhost'
DB_NAME='my_db'
DB_USER='root'
DB_PASSWD=''
DB_CHARSET='utf8'
# other environment settings ...

```

In your project, example:

```
'dsn' => 'mysql:host=' . $_ENV['DB_HOST'] . ';dbname=' . $_ENV['DB_NAME'];

```

**Enjoy :)**

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~111 days

Recently: every ~182 days

Total

18

Last Release

2658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f7a16a8b9afbd7222ecacc9dfca006c08f1156e7c62531ebd6bd32e53661a8b?d=identicon)[AlexeyKulagin](/maintainers/AlexeyKulagin)

---

Top Contributors

[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (147 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (114 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (80 commits)")[![Ragazzo](https://avatars.githubusercontent.com/u/1748844?v=4)](https://github.com/Ragazzo "Ragazzo (36 commits)")[![SilverFire](https://avatars.githubusercontent.com/u/4499203?v=4)](https://github.com/SilverFire "SilverFire (19 commits)")[![maximal](https://avatars.githubusercontent.com/u/980679?v=4)](https://github.com/maximal "maximal (14 commits)")[![DavertMik](https://avatars.githubusercontent.com/u/220264?v=4)](https://github.com/DavertMik "DavertMik (13 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (9 commits)")[![ale10257](https://avatars.githubusercontent.com/u/20130612?v=4)](https://github.com/ale10257 "ale10257 (8 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (7 commits)")[![lucianobaraglia](https://avatars.githubusercontent.com/u/374554?v=4)](https://github.com/lucianobaraglia "lucianobaraglia (6 commits)")[![ricpelo](https://avatars.githubusercontent.com/u/616169?v=4)](https://github.com/ricpelo "ricpelo (5 commits)")[![damasco](https://avatars.githubusercontent.com/u/1377554?v=4)](https://github.com/damasco "damasco (5 commits)")[![githubjeka](https://avatars.githubusercontent.com/u/874234?v=4)](https://github.com/githubjeka "githubjeka (5 commits)")[![slavcodev](https://avatars.githubusercontent.com/u/757721?v=4)](https://github.com/slavcodev "slavcodev (4 commits)")[![pana1990](https://avatars.githubusercontent.com/u/6630197?v=4)](https://github.com/pana1990 "pana1990 (4 commits)")[![mohorev](https://avatars.githubusercontent.com/u/4974062?v=4)](https://github.com/mohorev "mohorev (3 commits)")[![Naktibalda](https://avatars.githubusercontent.com/u/395992?v=4)](https://github.com/Naktibalda "Naktibalda (2 commits)")[![janisto](https://avatars.githubusercontent.com/u/387868?v=4)](https://github.com/janisto "janisto (2 commits)")[![ElisDN](https://avatars.githubusercontent.com/u/1673552?v=4)](https://github.com/ElisDN "ElisDN (2 commits)")

---

Tags

frameworkyii2project templatebasic

### Embed Badge

![Health badge](/badges/ale10257-yii2-app-basic-with-env-settings/health.svg)

```
[![Health](https://phpackages.com/badges/ale10257-yii2-app-basic-with-env-settings/health.svg)](https://phpackages.com/packages/ale10257-yii2-app-basic-with-env-settings)
```

###  Alternatives

[developeruz/yii-vue-app

Yii 2 + Vue.js Basic Project Template

1221.6k](/packages/developeruz-yii-vue-app)[yii2mod/base

Base application template for Yii2

531.3k](/packages/yii2mod-base)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
