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,fileinfoandjson(all normally enabled). - MySQL 8 or MariaDB 10.5 and later, with
utf8mb4. - Apache with
mod_rewrite(an.htaccessis provided), or any server that sends every request topublic/index.php. - HTTPS for any real use.
- Cron (or a scheduler) for two small jobs.
- PHP’s
upload_max_filesizeandpost_max_sizeof 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
- Get the code onto the server (clone the repository or upload it). If the web root is the repository root, the included top-level
.htaccessserves onlypublic/and blocksapp/,database/,scripts/,tests/,docs/,storage/and dotfiles. If you can set the web root, point it atpublic/. - Create a database and a database user with rights to it.
- Create
.envfrom.env.exampleand fill it in (see below). - Add the encryption key:
php scripts/make-key.phpaddsAPP_KEYto.envonce and never overwrites an existing key. - Create the tables:
php scripts/migrate.php. - Create your organisation and its first administrator:
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.)php scripts/create-organisation.php "Your Organisation" you@example.org - Schedule the jobs (see operations).
Settings (.env)
A real environment variable of the same name overrides the file.
| Setting | Meaning |
|---|---|
APP_ENV | production normally. |
APP_DEBUG | false in production. When true, errors are shown on screen: never on a live site. |
APP_URL | The 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_PASS | Database connection. On shared hosting use 127.0.0.1 and port 3306. |
APP_KEY | 32 random bytes, base64. Encrypts National Insurance and bank details. Back it up separately and never change it. |
DEMO_MODE | true shows a demo banner, enables the demo login help and allows the demo reset script. Never on a live installation. |
OWNER_EMAIL, OWNER_PASSWORD_HASH | Demo 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_SECRET | Microsoft sign-in. See Sign in with Microsoft. |
ENTRA_REDIRECT_URI | Optional. Defaults to APP_URL/login/entra/callback. |
PASSWORD_LOGIN | false 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