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 running on a subdomain, 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.Prerequisites
Before you start, make sure you have:- A subdomain pointed at your shared hosting account (e.g.
app.mysite.com) - A MySQL database created, with a username and password noted down
- FTP access to your hosting account
- The FrankPHP zip file downloaded from Gumroad
Step 1: Unzip and configure
Unzip the download. You’ll get a single folder containing the full framework. OpenConfig/config.php. This is the only file you need to edit before uploading.
Step 2: Import the database schema
In your hosting control panel, open phpMyAdmin (or your preferred MySQL client) and select your database. Import the filesql/schema.sql from the zip. This creates all the tables FrankPHP needs and inserts two seed accounts so you can log in immediately.
Most shared hosts provide phpMyAdmin. Look for it under the “Databases” section of your control panel (cPanel, Plesk, etc.).
Step 3: Upload via FTP
Connect to your hosting account via FTP and navigate to the folder that serves your subdomain (e.g.app.mysite.com/ maps to a folder like public_html/app/ — check with your host if you’re unsure).
Upload the entire contents of the unzipped folder into that directory. The index.php file should sit at the root of your subdomain’s folder.
Step 4: Verify it’s working
Open your subdomain in a browser:https://app.mysite.com
You should see the FrankPHP login screen.
If you see a login form, the framework is installed correctly.
Config/config.phphas incorrect database credentials- The schema hasn’t been imported yet
- File permissions — your host may require folders to be
755and files644
Step 5: Log in with a seed account
The schema creates two accounts inside Tenant 1 — one with admin rights, one with standard user access.| Role | Password | |
|---|---|---|
| Admin / Owner | owner@tenant1.com | password |
| User | user@tenant1.com | password |
Step 6: Create your first page
Now let’s build something. You’re going to add a new protected page — a simple “Hello World” that only a logged-in user can see. This touches every layer of the framework in the simplest possible way.6a. 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.
6b. Create the controller
Create a new file:Controllers/HelloController.php
6c. Create the view
Create a new file:Views/hello/index.php
6d. Upload and visit
Upload the two new files via FTP (just those two — no need to re-upload the whole framework). Then visit:If you can see the page, congratulations — 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 row from the database, and attached it to the request - AuthMiddleware ran second — it checked your session, loaded your user, confirmed you belong to tenant 1, and attached you to the request
HelloController@indexreceived the request with$request->tenantand$request->useralready populated- The view rendered inside
app-main.php, the authenticated layout
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