Documentation Index
Fetch the complete documentation index at: https://docs.n3wmedia.com/llms.txt
Use this file to discover all available pages before exploring further.
Get FrankPHP Running
By the end of this guide you’ll have FrankPHP installed on a subdomain, configured with a standard.env file, be logged in as a real user, and have built your first protected page. That’s enough to know the framework is working and to get a feel for how it thinks.
Your host needs PHP 8.0 or higher and MySQL. Nothing else. No Composer, no Node, no build tools.
Step 1: Create your MySQL database
Log in to your hosting control panel and create a new, empty MySQL database. Most shared hosts do this through phpMyAdmin or a dedicated “MySQL Databases” section (cPanel, Plesk, etc.). Note down the following — you’ll need them in the next step:- Database name
- Database username
- Database password
- Host (almost always
localhoston shared hosting)
Step 2: Configure FrankPHP locally with .env
Unzip your Gumroad download on your local machine. You’ll get a single folder containing the full framework.
FrankPHP now uses a standard .env file for environment-specific credentials. This keeps secrets out of your main config structure and makes FrankPHP feel more familiar if you’ve used other PHP frameworks before.
Create a new file in the root of the project called .env.
Add your database credentials and core app settings:
.env.example file, copy that first and rename it to .env, then fill in your real values.
The
.env file is for environment-specific settings only. Keep framework defaults and non-sensitive application settings in the normal config structure. Use .env for things like database credentials, mail credentials, and other secrets.Step 3: Set up your directory structure on the server
Connect to your hosting account via FTP and navigate to your root directory. Create the following three folders:This structure keeps your projects cleanly separated from the start. The
www and docs folders are optional right now — what matters is creating app.Step 4: Upload FrankPHP into the app directory
Upload the entire contents of your unzipped FrankPHP folder into the/app directory you just created.
Check: bootstrap.php should sit at the root of /app, not inside a subfolder.
Your .env file should also sit at the root of /app.
Step 5: Point your subdomain to the public folder
This is the most important configuration step, and it’s worth understanding why. FrankPHP contains a/public subdirectory inside /app. This is the only folder your subdomain should point to. Your hosting control panel will have a setting for “Document Root” or “Web Root” when you create the subdomain — set it to:
app.yoursite.com to /app/public.
Step 6: Initialise the database
Back in phpMyAdmin, select your database and initialise it using thesql/schema.sql file from your FrankPHP download. You have two options:
Option A — Import the file directly:
Use the Import tab in phpMyAdmin and select sql/schema.sql.
Option B — Copy and paste:
Open sql/schema.sql in a text editor, copy the entire contents, and paste it into the SQL command window in phpMyAdmin. Click Go.
Either approach creates all the tables FrankPHP needs and seeds two user accounts so you can log in immediately.
Step 7: Open FrankPHP in your browser
Navigate tohttps://app.yoursite.com in your browser.
You should see the FrankPHP login screen.
If you see a login form, FrankPHP is installed correctly. Everything worked.
.envhas incorrect database credentials- The subdomain is pointing to
/appinstead of/app/public - The schema hasn’t been imported yet
- File permissions — your host may require folders to be
755and files644
Step 8: Log in
The schema seeds two accounts inside Tenant 1 — one owner-level, one standard user:| Role | Password | |
|---|---|---|
| Admin / Owner | owner@tenant1.com | password |
| User | user@tenant1.com | password |
Step 9: Build your first page
FrankPHP is running. Now let’s prove it properly by building something — a simple protected page that only a logged-in user can see. This touches every layer of the framework in the most straightforward way possible.9a. Register the route
Openbootstrap.php and find the route definitions. Add one new line inside the existing authenticated routes block:
HelloController@index, and run the Tenant and Auth middleware first.
9b. Create the controller
Create a new file:Controllers/HelloController.php
9c. Create the view
Create a new file:Views/hello/index.php
9d. Upload and visit
Upload just the two new files via FTP — no need to re-upload the whole framework. Then visit:If you can see the page, you’ve just built your first FrankPHP feature. The route, middleware, controller, and view are all working together correctly.
What just happened
It’s worth pausing to understand what FrankPHP did when you visited that URL:index.phploadedbootstrap.phpand dispatched the request- The router matched
/tenant/1/helloand identified your controller - TenantMiddleware ran first — it read
1from the URL, loaded the tenant from the database, and attached it to the request - AuthMiddleware ran second — it checked your session, loaded your user, confirmed they belong to tenant 1, and attached them to the request
HelloController@indexreceived the request with$request->tenantand$request->useralready populated- The view rendered inside
app-main.php, the authenticated layout
Why .env is worth using
Moving credentials into .env gives FrankPHP a cleaner separation between code and secrets.
It also brings three practical benefits:
- Better security — credentials live outside the public web root and outside your main config file
- Cleaner deployments — each environment can have its own
.envwithout editing framework code - More familiar workflow — developers coming from Laravel, Symfony, and other PHP frameworks will immediately understand the pattern
Next steps
- Add a form — learn how to handle POST requests and save data to the database
- Understand middleware — see the full middleware cheatsheet and when to use each combination
- Start your application — fill in Section 14 of
CODEBASE.mdwith your app’s name, tables, and routes - Configure version management — use the new release tooling to track versions, changes, and packaged zip releases