Installation Instructions



ZN Framework is installed with almost no settings required. Depending on the distribution type, options such as direct download or installation with composer are also available. Don't forget to check the pre-installation requirements and then check the server and authorization configurations.

 

 

# Section Headings


# Requirements
# Setups by Edition

# Fullpack Edition
# Original Edition
# Single Edition
# Custom Edition
# Light Edition
# Shared Edition
# Devtools
# Default Project
# Shared Extension

# Authorization Configurations

# Linux

# Server Configurations

# Apache
# Nginx

# Docker Working Environment

# Docker Installation
# Build
# Change Port
# Restart
# Docker Compose Commands

# Troubleshooting

 

 

# Requirements


PHP must be at least 7.0.0 version.
If the server software is apache, the AllowOverride value should be set to All instead of None and the mod_rewrite property should be turned on.
MB String extension must be installed.

 

 

# Setups by Edition


Below are different distributions according to the purpose of use. For distributions that require installation with Composer, composer must first be installed on your server. If it is not installed, click to install

Fullpack Edition

this version is installed to include all libraries of the ZN Framework, without the need for composer. It is recommended for those who will work on more hosts. The update process is carried out through Devtools and Console application instead of composer.

Installation

↓ Download

Update

In this version, the update is carried out via the console or the Devtools application. Updating is done from the Devtools menu below.

URL: yoursite.com/Devtools/system/info
Original Edition

It is the original version of ZN Framework. This version installs other packages along with it.

Installation

> composer create-project znframework/znframework

Update

> composer update
Single Edition

this version has the directory structure of any project belonging to the Projects/ directory in the original version of the ZN Framework. If there will not be more than one project under the same roof, it may be preferred to use this version due to its simpler directory structure.

Installation

> composer create-project znframework/single-edition

Update

> composer update
Custom Edition

It is the version that allows you to build your own code framework. In this version, you are designing the directory structure according to you.

Installation

> composer create-project znframework/custom-edition

Update

> composer update

Usage

Click for usage.

Light Edition

Blended from the custom-edition package of the ZN Framework, it is a special lightweight version that offers simple and convenient use.

Installation

> composer create-project znframework/light-edition

Update

> composer update
Shared Edition

It is the version of the ZN Framework that offers a rational and secure use, blended from the custom-edition package and shared-extension repository, and includes a common sharing directory.

Installation

> composer create-project znframework/shared-edition

Configuration

DocumentRoot in Apache and root value in Nginx should be as follows.

/var/www/html/public

Update

> composer update
Devtools

Provides a panel of various tools that allow you to better use Devtools Framework tools. It helps you manage your roof better through this panel.

Devtools can only be used in ZN OE and ZN FE versions. The installation should be done to the Projects/ directory included in these editions.

Installation

> composer create-project znframework/developer-tools Devtools

Access

After installation, you can access Devtools via yoursite.com/Devtools. If you are accessing locally, you can log in directly to the panel. In case of access via the server, it will ask for user name and password information. You can use the file below to set a username and password.

Dosya: Devtools/Config/Dashboard.php
'users' => ['username' => 'password']
Default Project

It is used to open a new project for ZN OE and ZN FE editions.

The installation should be done to the Projects/ directory included in these editions.

Installation

> composer create-project znframework/default-project NewProjectName
Shared Extension

Used to set the working directory as a subfolder for directory and file access security. This directory is commonly called public/. This repo is installed in the directory where ZN Framework is installed. After this installation, the DocumentRoot line in the server configuration section described in a few titles should be edited as /var/www/html/public. The directory name can be changed according to your preference.

Installation

> composer create-project znframework/shared-extension public

 

 

# Authorization Configurations


Since file writing operations are used automatically in ZN Framework, authorization problems may be encountered in some operating systems. It is shown below for which operating system these settings can be made.

Linux

In order to avoid authorization problems after installation, files and directories should be authorized in ZN Framework.

$ chown apache:apache -R /var/www/html/{project-directory}
$ find /var/www/html/{project-directory} -type d -exec chmod 0755 {} \;
$ find /var/www/html/{project-directory} -type f -exec chmod 0644 {} \;
$ chmod g+w -R /var/www/html/{project-directory}

 

 

# Server Configurations


Below is shown how to configure both apache and nginx.

Apache

For Apache, the content of the configuration file usually found in /etc/apache/sites-available/000-default.conf should be as follows.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    <Directory /var/www/html>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Nginx

For Nginx, the content of the configuration file usually found in /etc/nginx/sites-available/default should be as follows.

server 
{
    listen 80 default_server;

    root /var/www/html;

    index zeroneed.php;

    error_page 403 /zeroneed.php;

    location / 
    {
        try_files $uri /zeroneed.php?$args;
        proxy_pass http://127.0.0.1:80;
    }

    location ~ zeroneed.php$ 
    {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    }

    location ~ "\/Resources\/\w+\/.*?\.[a-zA-Z0-9]{2,4}$"
    {
        try_files $uri /".*?\/Resources\/";
    }
}

 

 

# Docker Working Environment [5.9.0]


After downloading the ZN Framework to your operating system, the 5.9.0 and later versions of the ZN Framework come with the necessary files to create a working environment with docker. In order to install the working environment with Docker, you must have the docker installed in your operating system.

If you set up with Docker, you can create an environment to start project development without dealing with any server configuration independent of the operating system or extra setups. Docker installs all necessary packages and plugins that are ideal for the operation of the ZN Framework via the Dockerfile file included in the ZN.

Install Docker

Click to install Docker according to the operating system.

Build

For the installation of the working environment, use the following console command at the directory level where ZN Framework is installed.

> composer build

Access to the Project

In the Docker configuration, 8080 port is used by default. URL information to access the project should be as follows.

URL: localhost:8080/  veya 127.0.0.1:8080/

Now your working environment is ready.

Change Port

To change port 8080, change the 8080 value in docker-compose.yml file and run the following command.

> composer apply
Restart

You can use the following command to completely stop and restart the working environment.

> composer restart
Docker Compose Commands

There are predefined docker commands in the composer.json file.

composer build It installs the ZN Framework in the Docker environment.
composer restart It shuts down and restarts all docker services.
composer apply Enables the restart of the services required to implement changes to the dockerfile and docker-compose.yml file.
composer start It allows the services that are not running to be restarted.
composer down Stops services
composer up Restarts services from the beginning.

You can follow the link below for other commands.

https://docs.docker.com/compose/reference/overview/

 

 

# Troubleshooting


If you encounter a different problem after installation, you can find the available solutions from the troubleshooting page.