FREQUENTLY ASKED QUESTIONS

Last updated: June 29th 2026

General

What is Simply PHP?

A lightweight PHP micro-framework with a flat-file CMS, Eloquent ORM, routing, session management, validation, file storage, and an admin panel — all in a single, easy-to-understand codebase.

What PHP version do I need?

Simply PHP supports PHP 7.4 and up. The core framework works on 7.4+; S3 file storage requires PHP 8.4+ (for the AWS SDK).

Do I need Composer?

Yes. Dependencies (Eloquent ORM, Flysystem, Twig, etc.) are managed via Composer. Run composer install after cloning.

Does it use a database?

Not required out of the box — the flat-file CMS uses JSON files. But the framework ships with Eloquent ORM, so adding a MySQL/PostgreSQL/SQLite database is straightforward.

Routing

How do I define a route?

Open app/Routes.php and use the Router facade:
Router::get('hello/{name}', 'Hello@greet');
Router::post('contact', 'Contact@send');
Router::resource('posts');

How do I group routes under a prefix?

Use Router::group():
Router::group(['prefix' => 'admin'], function () {
    Router::get('dashboard', 'Admin@dashboard');
    Router::get('users', 'Admin@users');
});

Why does my controller method need an "Action" suffix?

Simply PHP uses the Action suffix convention — indexAction, storeAction, etc. This prevents conflicts with PHP internal methods. The dispatcher automatically appends Action if the bare method name is not found, so both index and indexAction work.

File Storage

How do I configure storage disks?

Create app/Config/Storage.php with the STORAGE_DISKS and STORAGE_DEFAULT constants. Then call Storage::configure() in your front controller. See the File Upload docs for examples.

How do I use S3 for file storage?

Add an s3 disk to your STORAGE_DISKS config with driver => 's3' plus your key, secret, region, and bucket. Then use Storage::disk('s3') to interact with it. Requires PHP 8.4+.

How do I serve private files?

Create a controller that checks authentication, reads from the private disk, and streams the file with the correct Content-Type header. See the File Upload docs for an example.

Troubleshooting

I get a 404 on every page except the homepage

Make sure your web server is configured to rewrite all requests to public/index.php. For Apache, the public/.htaccess file handles this. For nginx, add:
location / {
    try_files $uri $uri/ /index.php?$query_string;
}
Also verify that mod_rewrite is enabled.

I get a blank white screen

Enable error display temporarily in public/index.php:
ini_set('display_errors', 1);
error_reporting(E_ALL);
Common causes: missing vendor directory (run composer install), PHP version too low, or a missing config file.

Session data is not persisting between requests

Ensure session_start() is called in your front controller before any output. The framework's Session::init() handles this. Also check that app/storage/framework/sessions is writable by the web server.

How do I switch between Whoops and the built-in error handler?

Simply PHP ships with two error presentation modes:

  • Whoops (default) — pretty, detailed error pages with syntax-highlighted source code, perfect for development.
  • Simply — the framework's own error handler, which shows a styled error page when SHOW_ERRORS=true and logs to Monolog when SHOW_ERRORS=false.

Set the handler via the ERROR_HANDLER environment variable in .env:

ERROR_HANDLER=whoops   # Pretty error pages (default)
ERROR_HANDLER=simply   # Framework's built-in handler

To hide errors in production, set SHOW_ERRORS=false in your .env (errors will still be logged to simply/logs/):

SHOW_ERRORS=false