PHPackages                             linna/app - 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. linna/app

ActiveProject[Framework](/categories/framework)

linna/app
=========

Linna Application

v0.16.1(3y ago)6363[1 issues](https://github.com/linna/app/issues)MITPHPPHP &gt;=8.0CI passing

Since Sep 1Pushed 1y ago2 watchersCompare

[ Source](https://github.com/linna/app)[ Packagist](https://packagist.org/packages/linna/app)[ Docs](https://github.com/linna/app)[ RSS](/packages/linna-app/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (6)Versions (30)Used By (0)

 [![Linna Logo](logo-linna-128.png)](#)

 [![Linna dotenv Logo](logo-app.png)](#)

[![Tests](https://github.com/linna/app/actions/workflows/tests.yml/badge.svg)](https://github.com/linna/app/actions/workflows/tests.yml)[![PDS Skeleton](https://camo.githubusercontent.com/3c7140ee36205075ed977142f25c29eb1fb7809e9b86a865461fc21776ad1665/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d736b656c65746f6e2d626c75652e7376673f7374796c653d666c6174)](https://github.com/php-pds/skeleton)[![PHP 8.1](https://camo.githubusercontent.com/1c708345a94c698fd596459da39a9535062cfa1162a57a8ae4e3cdd54e00a25d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312d3838393242462e737667)](http://php.net)

About
=====

[](#about)

Application Skeleton for Linna framework

Actual stable environment
-------------------------

[](#actual-stable-environment)

- app 0.16.0
- framework 0.27.0
- auth-mapper-\* 0.2.0

Index
=====

[](#index)

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Before first run](#before-first-run)
    - [Protocol and app dir config](#protocol-and-app-dir-config)
    - [Router config](#router-config)
4. [Url rewriting](#url-rewriting)
    - [Apache Virtual Host config for mod\_rewrite](#apache-virtual-host-config-for-mod_rewrite)
    - [Apache .htaccess config for mod\_rewrite](#apache-htaccess-config-for-mod_rewrite)
    - [Nginx](#nginx)
5. [Dot env file](#dot-env-file)

Requirements
============

[](#requirements)

- App need [linna/framework](https://github.com/linna/framework), please read the [changelog](https://github.com/linna/app/blob/b0.16.0/CHANGELOG.md) for know with which version the app works.
- PHP 7.4 or higher.

> **Note:** App was only tested under Linux with Apache web server with default php.ini

Installation
============

[](#installation)

> **Note:** Consider use of sudo command if need administrator privileges and don't forget to set proper folder permissions

With [composer](https://getcomposer.org/)

```
cd /var/www/html
mkdir app
composer create-project --prefer-dist linna/app app
```

Where `app` is directory under webserver document root ex. `/var/www/html/app`

After, run composer [dump-autoload](https://getcomposer.org/doc/03-cli.md#dump-autoload) for optimize file autoloading

```
composer dump-autoload --optimize
```

Before first run
================

[](#before-first-run)

Change config in `config.php` file placed in `/var/www/html/app/config` directory.

Protocol and app dir config
---------------------------

[](#protocol-and-app-dir-config)

```
$options = [

    'app' => [
        //protocol utilized [http://, https://]
        //default value set automatically
        'protocol'     => REQUEST_SCHEME.'://',
        //folder of the app, if app isn't in the web server root add a
        //directory (/app, /other/app) else insert a / (slash) as value
        //default value [/app]
        'subFolder'    => '/app',
        //public folder of the app, starting from web server root
        //default value [/app/public]
        'publicFolder' => '/app/public',
        //.env file position, remember to add ../ if don't use an absolute path
        'envFile'      => '../.env',
        //name of the fallback route, indicate the path when router return a NullRoute
        //default /error/404
        'onNullRoute'  => '/error/404'
    ],

    //other options
];
```

Router config
-------------

[](#router-config)

```
$options = [

    //other options

    'router' => [
        //must be equal to app.subFolder, it represents the part of the path
        //that the router ignore when check a route. Example '/app/user/delete/5'
        //become '/user/delete/5' where the router subtract the basePath
        //default [/app]
        'basePath'             => '/app',
        //url rewriting
        //default [true]
        'rewriteMode'          => true,
        //part of the url that the router ignore when url rewriting is off
        'rewriteModeOffRouter' => '/index.php?',
    ],

    //other options
];
```

Url rewriting
=============

[](#url-rewriting)

If you enable the option of the router named `rewriteMode` in `config.php`, need to configure your virtual host/server block.

Apache Virtual Host config for mod\_rewrite
-------------------------------------------

[](#apache-virtual-host-config-for-mod_rewrite)

For Apache VirtualHost config please see:

For Apache mod\_rewrite config please see:

```

    # Other virtual host directives.

        RewriteEngine on
        # Route to /app/public
        RewriteRule ^(.*)  public/$1 [L]

        # Necessary to prevent problems when using a controller named "index" and having a root index.php
        # more here: http://httpd.apache.org/docs/current/content-negotiation.html
        Options -MultiViews

        # Activates URL rewriting (like myproject.com/controller/action/1/2/3)
        RewriteEngine On

        # Prevent people from looking directly into folders
        Options -Indexes

        # If the following conditions are true, then rewrite the URL:
        # If the requested filename is not a directory,
        RewriteCond %{REQUEST_FILENAME} !-d
        # and if the requested filename is not a regular file that exists,
        RewriteCond %{REQUEST_FILENAME} !-f
        # and if the requested filename is not a symbolic link,
        RewriteCond %{REQUEST_FILENAME} !-l

        # then rewrite the URL in the following way:
        # Take the whole request filename and provide it as the value of a
        # "url" query parameter to index.php. Append any query string from
        # the original URL as further query parameters (QSA), and stop
        # processing (L).
        # https://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa
        # https://httpd.apache.org/docs/current/rewrite/flags.html#flag_l
        RewriteRule ^(.+)$ index.php [QSA,L]

    # Other virtual host directives.

```

Apache .htaccess config for mod\_rewrite
----------------------------------------

[](#apache-htaccess-config-for-mod_rewrite)

If you haven't access to your apache virtual host configuration, you can add .htaccess files to the app for enable mod\_rewrite.

Create `.htaccess` file in `app/` directory with this content:

```
RewriteEngine on
# Route to /app/public
RewriteRule ^(.*)  public/$1 [L]
```

Create `.htaccess` file in `app/public/` directory with this content:

```
# Necessary to prevent problems when using a controller named "index" and having a root index.php
# more here: http://httpd.apache.org/docs/current/content-negotiation.html
Options -MultiViews

# Activates URL rewriting (like myproject.com/controller/action/1/2/3)
RewriteEngine On

# Prevent people from looking directly into folders
Options -Indexes

# If the following conditions are true, then rewrite the URL:
# If the requested filename is not a directory,
RewriteCond %{REQUEST_FILENAME} !-d
# and if the requested filename is not a regular file that exists,
RewriteCond %{REQUEST_FILENAME} !-f
# and if the requested filename is not a symbolic link,
RewriteCond %{REQUEST_FILENAME} !-l

# then rewrite the URL in the following way:
# Take the whole request filename and provide it as the value of a
# "url" query parameter to index.php. Append any query string from
# the original URL as further query parameters (QSA), and stop
# processing (L).
# https://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa
# https://httpd.apache.org/docs/current/rewrite/flags.html#flag_l
RewriteRule ^(.+)$ index.php [QSA,L]
```

Nginx
-----

[](#nginx)

For Nginx Server Blocks config please see:
[https://www.nginx.com/resources/wiki/start/topics/examples/server\_blocks/](https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/)

Setting url rewrite with Nginx is simpler than Apache counterpart, add `try_files $uri $uri/ /index.php?$args;` to `location` block:

```
server {

    # Other directives

    location / {
        # Url rewrite
        # Add line blow to location block for enable url rewriting
        try_files $uri $uri/ /index.php?$args;
    }

    # Other directives
}
```

Dot env file
============

[](#dot-env-file)

With `composer` installation, a `.env` file is created into `app` root directory and it could be used for declaring default environment variables.

`.env` file content look like this:

```
# Session
session.name   = linna_session
session.expire = 1800

## Pdo Mysql
pdo_mysql.user     = root
pdo_mysql.password =

## Mysqli
#mysqli.host     = 127.0.0.1
#mysqli.user     = root
#mysqli.password =
#mysqli.database = linna_db
#mysqli.port     = 3306

## MongoDB
#mongo_db.uri = mongodb://localhost:27017

## Memcached
#memcached.host = localhost
#memcached.port = 11211

```

`.env` file valid keys:

```
session.name
session.expire

pdo_mysql.dsn
pdo_mysql.user
pdo_mysql.password

pdo_pgsql.dsn
pdo_pgsql.user
pdo_pgsql.password

mysqli.host
mysqli.user
mysqli.password
mysqli.database
mysqli.port

mongo_db.uri

memcached.host
memcached.port

```

Values declared in the file will overwrite `config.php` values.

Position of `.env` file could be changed editing `envFile` value.

```
$options = [

    'app' => [
        //other app options
        'envFile'           => '../.env'
    ],

    //other options
];
```

If you do not want use `.env` file can delete it.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~92 days

Recently: every ~373 days

Total

25

Last Release

1366d ago

PHP version history (4 changes)v0.1.0PHP &gt;=5.6.0

v0.3.0PHP &gt;=7.0.0

v0.13.0PHP ^7.1

v0.16.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b0180939371d6dbe2ab2d18829614d90a995b833d6bb7f503a11766f8d130f0?d=identicon)[s3b4stian](/maintainers/s3b4stian)

---

Top Contributors

[![s3b4stian](https://avatars.githubusercontent.com/u/11441761?v=4)](https://github.com/s3b4stian "s3b4stian (373 commits)")

---

Tags

appmvcphpskeletonphpmvcapplicationSkeletonlearning

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/linna-app/health.svg)

```
[![Health](https://phpackages.com/badges/linna-app/health.svg)](https://phpackages.com/packages/linna-app)
```

###  Alternatives

[fuel/fuel

FuelPHP is a simple, flexible, community driven PHP 5.4+ framework, based on the best ideas of other frameworks, with a fresh start!

1.5k42.6k](/packages/fuel-fuel)

PHPackages © 2026

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