← PHPenalva home

1. Clone and install

git clone https://github.com/yanpenalva/phpenalva.git
cd phpenalva
cp .env.example .env
composer install

2. Prepare the database

The clone ships with a migrated SQLite database, so this is a no-op on a fresh checkout. For a clean database, delete it and migrate:

rm -f database/database.sqlite
php bin/phpenalva migrate

Expected output:

Applied migration: CreateUsersTable
Applied migration: CreatePostsTable

An empty or missing DB_CONNECTION selects SQLite. MySQL, PostgreSQL, and SQL Server need their PDO driver installed and DB_* set in .env.

3. Serve and make the first request

php -S 127.0.0.1:8000 -t public

In another terminal:

curl -s -o /dev/null -w "GET / -> %{http_code}\n" http://127.0.0.1:8000/
curl -s http://127.0.0.1:8000/api

Expected: GET / -> 200 and a JSON envelope from /api:

{"status":"success","message":"Welcome to the API PHPenalva","data":[],"errors":[]}

Next guides