Demo All names and records here are made up, and the data resets every night. Please do not enter real personal information. ← Back to Find Care Scotland software · All software
Care Core

Documentation › Running it › Installing

Installing

Requirements, setup and every setting.

Care Core is plain PHP and MySQL with no framework and no build step. It runs on ordinary shared hosting.

Requirements

  • PHP 8.1 or newer with the extensions pdo_mysql, openssl, curl, mbstring, fileinfo and json (all normally enabled).
  • MySQL 8 or MariaDB 10.5 and later, with utf8mb4.
  • Apache with mod_rewrite (an .htaccess is provided), or any server that sends every request to public/index.php.
  • HTTPS for any real use.
  • Cron (or a scheduler) for two small jobs.
  • PHP’s upload_max_filesize and post_max_size of at least 4 MB, so 3 MB photos can be uploaded.
Keep PHP patched. Check your host runs a currently supported, patched PHP release.

Install

  1. Get the code onto the server (clone the repository or upload it). If the web root is the repository root, the included top-level .htaccess serves only public/ and blocks app/, database/, scripts/, tests/, docs/, storage/ and dotfiles. If you can set the web root, point it at public/.
  2. Create a database and a database user with rights to it.
  3. Create .env from .env.example and fill it in (see below).
  4. Add the encryption key: php scripts/make-key.php adds APP_KEY to .env once and never overwrites an existing key.
  5. Create the tables: php scripts/migrate.php.
  6. Create your organisation and its first administrator:
    php scripts/create-organisation.php "Your Organisation" you@example.org
    It prints a one-time invitation link: open it to choose your own password, then sign in. (You can set up Microsoft sign-in after that.) (For a quick look at Care Core with sample data instead, load the demo: see Tests and demo data.)
  7. Schedule the jobs (see operations).

Settings (.env)

A real environment variable of the same name overrides the file.

SettingMeaning
APP_ENVproduction normally.
APP_DEBUGfalse in production. When true, errors are shown on screen: never on a live site.
APP_URLThe public address, for example https://core.example.org. Used for invitation links, the SCIM address and the Microsoft redirect address. (SITE_URL is accepted as an alias.)
DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSDatabase connection. On shared hosting use 127.0.0.1 and port 3306.
APP_KEY32 random bytes, base64. Encrypts National Insurance and bank details. Back it up separately and never change it.
DEMO_MODEtrue shows a demo banner, enables the demo login help and allows the demo reset script. Never on a live installation.
OWNER_EMAIL, OWNER_PASSWORD_HASHDemo installations only: an administrator login of your own that is put back after every nightly reset. The hash is made on your own computer (see .env.example); the password itself is never stored in a file.
ENTRA_TENANT_ID, ENTRA_CLIENT_ID, ENTRA_CLIENT_SECRETMicrosoft sign-in. See Sign in with Microsoft.
ENTRA_REDIRECT_URIOptional. Defaults to APP_URL/login/entra/callback.
PASSWORD_LOGINfalse turns passwords off for everyone except administrators once Microsoft sign-in is configured. Default true.

Where files go

Photos and signatures are saved under storage/uploads/, and a cache file for Microsoft’s signing keys under storage/cache/. Both directories are created as needed, must be writable by the web server’s user, must not be served by the web server, and must be backed up with the database.

Running locally

cp .env.example .env            # set DB_*, APP_KEY (php scripts/make-key.php), DEMO_MODE=true
php scripts/migrate.php
php scripts/demo-reset.php      # optional demo data (database name must contain "demo")
php -S localhost:8990 -t public public/index.php