---
title: "Installation Festi Project"
url: https://festi.dev/8.0/Install/
---

# Installation Festi Project

You can set up a project manually or use [Festi CLI](https://festi.dev/8.0/Packages/CLI/index.md).

## Installation using composer

composer.json:

```json
{
    "name": "your_company/project_name",
    "description": "Description",
    "repositories": [
        { "type": "composer", "url": "https://packages.festi.io/" }
    ],
    "require": {
        "festi-team/festi-framework-core": "dev-develop",
        "festi-team/festi-framework-database": "dev-develop",
        "festi-team/festi-framework-theme": "dev-develop",
        "festi-team/festi-framework-cli": "dev-develop",
        "festi-team/festi-framework-di": "dev-master",
        "php": ">=8.0"
    },
    "minimum-stability": "dev",
    "autoload": {
        "psr-4": {
            "": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {"": ["tests"]}
    },
    "require-dev": {
        "phpunit/phpunit": "9.*",
        "phpunit/php-code-coverage": "9.*",
        "festi-team/coding-standard": "~1.1.0"
    },
    "config": {
        "allow-plugins": {
            "dealerdirect/phpcodesniffer-composer-installer": true
        }
    }
}
```

`festi-team/coding-standard` brings both analysers (`phpcs` and `phan`) and
registers the `Festi` standard with phpcs itself. The `allow-plugins` entry is
required, not optional: Composer 2.2+ refuses to run the installer plugin
without it, and `--standard=Festi` then fails with "standard is not
installed".

```
composer install
mkdir src
./vendor/bin/festi-install 
```

## Installation options

-   `dashboard` (default) - The **Jimbo** system plugin will be installed.
-   `site` - The **Jimbo** system plugin will be installed. Additionally, the **Contents** plugin will be installed.
-   `api` - The **RESTful** system plugin will be installed. The framework will operate in RESTful API mode.
-   `async` - A project based on Festi Async Framework will be created. For writing asynchronous services for IoT, Games, Data Streaming, etc.

During installation, you will be asked if you want to install demo content. 
If you agree, basic settings and routing for login/registration will be created.
Most projects require this and you should agree.

## PHP Configuration

The following `php.ini` settings are required for correct framework operation:

| Setting | Required Value | Notes |
|---|---|---|
| `short_open_tag` | `Off` | Must be disabled for correct DGS XML format support. When enabled, PHP interprets `<?` as an opening tag, which breaks XML declarations (`<?xml ...?>`). |

Example `php.ini`:

```ini
short_open_tag = Off
```

## Host Configuration
The domain should point to `[PROJECT_NAME]/src/[dashboard|api|site|async]`, or be a symbolic link.

For example, if the virtual host points to `/var/www/test_user/data/www/my-domain.dev.clients.in.ua`, then the structure would be:
`/var/www/test_user/data/www/`:
- `test_project`
    - `core`
    - `dumps`
    - `src`
        - `dashboard`
        - `api`
    - ...
- `my-domain.dev.clients.in.ua -> test_project/src/dashboard`

## Possible Installation Errors
> If there were errors during installation (for example, there was no database connection) then trying to reinstall may cause errors.

If the error is:
>   Installing [PLUGIN_NAME] Plugin... [ Info ]
>
>   'plugins/[PLUGIN_NAME]' already exists in the index [ ERROR ]
    
It means that the `[PLUGIN_NAME]` plugin has already been added to the repository as a submodule.

Solution:
1.  Remove the corresponding section from the **.gitmodules** file.
2.  Save changes to **.gitmodules** - `git add .gitmodules`
3.  Remove the corresponding section from **.git/config**
4.  Run `git rm --cached path_to_submodule` (without the slash).
5.  Run `rm -rf .git/modules/path_to_submodule` (without the slash).
6.  Delete the unprocessed submodule files `rm -rf path_to_submodule`

Now you can try installing again.

## Configuration for IIS

For Microsoft IIS server, place the `web.config` file in the root folder of the project:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite> 
    </system.webServer>
</configuration>
```

## Configuration for Nginx

For nginx server, you need to specify in `/etc/nginx/virtuals.conf`:

```
server {

    listen   80;
    server_name YOUR_HOST.com;

    access_log YOUR_PATH/logs/access.log;
    error_log YOUR_PATH/logs/error.log;

    root   YOUR_PATH;
    index   index.php index.html index.htm;

    location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                expires max;
                log_not_found off;
        }

    location = /index.php {
        root   YOUR_PATH;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    location / {
        rewrite ^ /index.php last;
    }

    location ~ /\.ht {
        deny  all;
    }
}
```


## Local Development

`festi-install` creates the Docker files of a project only when it is run
with `--docker y`:

```
./vendor/bin/festi-install --docker y
```

The project then has a `docker/` folder with one `docker-compose.yml`, a
`php/Dockerfile` and, for the Apache server, a `php/php.ini`. There is no
`docker-compose.sh`, no `docker-compose.base.yml` and no `environments/`
folder in a project: those belong to the repository of the framework
itself and are described in its `CONTRIBUTING.md`.

Start the project:

```
cd docker
docker compose up --build
```

With the Apache server the site is served on `http://localhost:8000`. The
services are the database, named after the database host given to the
installer, and `php-apache-environment`, which mounts the project at
`/var/www` and runs `festi-migrate` before Apache starts.

The PHP container runs as `www-data`, which takes the UID and GID 1000
when the image is built. If yours differ on a Linux host, export them
first, so that the mounted project stays writable:

```
export UID GID=$(id -g)
docker compose up --build
```

Run a command in the container:

```
docker compose exec php-apache-environment composer update
docker compose exec php-apache-environment ./vendor/bin/phpcs
docker compose exec php-apache-environment ./vendor/bin/phan
```

`composer install` registers the `Festi` coding standard through the
Composer plugin of the package, so there is no `--config-set
installed_paths` step. Check it with `./vendor/bin/phpcs -i`, which lists
`Festi` among the installed standards. If you are upgrading from the old
vendored `.phpcs/` directory, clear the stale path first, or phpcs keeps
resolving `Festi` to a standard that no longer exists:

```
./vendor/bin/phpcs --config-delete installed_paths
```

The installer creates an empty `tests/` folder: a project adds its own
`phpunit.xml` and tests there.
