zaro

How do I install Chronicle?

Published in Chronicle Installation 3 mins read

To install Chronicle, you'll need to follow a series of straightforward steps involving command-line operations and configuration adjustments. This process ensures all necessary dependencies are met, the database is set up, and the web server is properly configured to serve the application.

Key Installation Steps for Chronicle

The installation of Chronicle involves a few distinct phases, from setting up project dependencies to configuring your web server. Below is a detailed breakdown of each step.

  1. Install Composer Dependencies
    The first step is to ensure all required PHP packages and libraries are installed. This is managed using Composer, a dependency manager for PHP.

    • Navigate to your Chronicle project directory in your terminal.
    • Run the command:
      composer install

      This command will read the composer.json file and download all listed dependencies into your project.

  2. Execute the Chronicle Installer Script
    Chronicle provides a built-in installation script that handles initial setup tasks.

    • From your project root, execute the following PHP script:
      php bin/install

      This script typically sets up basic configurations or prepares the environment for further steps.

  3. Edit Local Settings
    Customizing your Chronicle instance requires editing its local settings file. This file often contains database connection details, application keys, and other environment-specific configurations.

    • Locate the file typically named local/settings.
    • Open this file with a text editor and adjust the settings according to your environment, especially database credentials and any other critical configurations.
  4. Set Up Database Tables
    Before Chronicle can function, its database schema needs to be created. This step populates your configured database with the necessary tables.

    • Run the database migration script:
      php bin/make-tables.php

      This command will create all the required tables for Chronicle's operation in the database you configured in local/settings.

  5. Configure Web Server or Use Built-in Server
    Finally, you need to make Chronicle accessible via a web server. You have two primary options:

    • Option A: Configure a Virtual Host (Recommended for Production)
      For a robust and production-ready setup, configure a new virtual host on your web server (such as Apache or Nginx). The virtual host should be set to point its document root to the public directory within your Chronicle installation. This ensures that only public-facing files are directly accessible, enhancing security.

    • Option B: Use Composer's Built-in Web Server (For Development/Testing)
      For quick testing or development purposes, Composer can launch a simple built-in web server.

      • From your project directory, execute:
        composer start

        This will typically launch a web server accessible via a local address (e.g., http://localhost:8000), allowing you to immediately access your Chronicle instance. Note that this is not recommended for production environments.

Following these steps will successfully install and set up your Chronicle instance, making it ready for use.