Skip to content

Requirements

This page describes what is needed to run the current motmaina-website application in a local or server environment.

The application is a PHP-based CodeIgniter monolith with MySQL, Nginx, and PHP-FPM in the provided development setup.

To run the website, the following are required:

  • PHP 7.4
  • MySQL 8.0 or a compatible MySQL server
  • Nginx or another web server capable of routing requests to index.php
  • Composer dependencies installed under vendor/

Based on the Dockerfile, the application expects these PHP extensions:

  • mysqli
  • pdo_mysql
  • mbstring
  • intl
  • zip
  • gd

The image also installs system packages needed for image processing, internationalization, and archive handling.

The runtime assumes the standard project layout remains intact:

  • index.php as the front controller
  • application/ for CodeIgniter application code
  • system/ for the framework core
  • vendor/ for Composer-loaded dependencies

If any of these are missing or moved without reconfiguration, the application will not boot correctly.

The application loads environment values from:

  • .env
  • .env.local
  • server environment variables

The most important variables visible from the current codebase are:

  • CI_ENV
  • DB_HOST
  • DB_USERNAME
  • DB_PASSWORD
  • DB_NAME
  • APP_TIMEZONE
  • MOTMAINA_ENVIRONMENT

The application uses MySQL through CodeIgniter’s mysqli driver and reads its connection settings from environment variables.

At minimum, the following must exist:

  • a reachable MySQL host
  • a database schema for the website
  • a database user with read and write access to that schema

The provided development setup uses:

  • database name: motmaina_website
  • username: motmaina
  • password: motmaina

The provided development environment uses Nginx with these expectations:

  • document root points to the project root
  • index.php is the main entry file
  • all unmatched requests are rewritten to /index.php?$query_string
  • PHP files are forwarded to PHP-FPM

This routing behavior is essential because the application depends on CodeIgniter’s request dispatching.

The repository already includes a Docker-based local setup in:

The containerized setup includes:

  • nginx:1.27-alpine
  • php:7.4-fpm
  • mysql:8.0

The exposed development ports are:

  • website: http://localhost:8080
  • database: localhost:3307

If the app is not run through Docker, the host machine still needs:

  • PHP 7.4 with the required extensions
  • a configured web server with request rewriting
  • a running MySQL instance
  • project dependencies installed through Composer
  • environment variables or .env files configured correctly

The project uses Composer and includes at least:

  • sentry/sentry

The codebase also contains bundled third-party libraries under application/third_party, including:

  • Google API PHP client
  • PHPMailer
  • PHPExcel

This means a successful runtime depends on both Composer-managed packages and legacy in-repo third-party libraries.

The application should have appropriate file permissions for operational directories such as:

  • application/cache
  • application/logs

In containerized development, permissions are prepared in the PHP image build.

Some features may require external credentials or service configuration depending on which flows are used:

  • email delivery providers
  • payment gateways such as Hyperpay or Tabby
  • Google service integrations
  • error monitoring through Sentry
  • SMS or messaging providers in production-like environments

These are not always required to boot the application, but they may be required for specific business workflows to function fully.

Practical Definition of “Ready to Run”

Section titled “Practical Definition of “Ready to Run””

The application should be considered ready to run when all of the following are true:

  1. PHP, MySQL, and the web server are available.
  2. Composer dependencies are installed.
  3. Environment variables are present.
  4. The database is reachable and contains the required schema.
  5. Request rewriting sends traffic into index.php.
  6. Cache and log directories are writable.

For local development, the safest path is to use the existing Docker setup rather than configuring the stack manually. It already reflects the expected runtime combination used by the current project.