The stupidly easy to learn and use PHP microframework!
A microframework is a term used to refer to minimalistic web
application frameworks. It lacks most of the functionality which
is common to expect in a full-fledged web application framework.
Seed-PHP is a microframework that offers you a really simple way
to implement powerfull RESTfull APIs or even simple websites that could support pretty much all needed methods and responses in JSON or XML formats.
Check the complete documentation.
- PHP
^8.1(8.1 or newer). - Extensions:
curl,ctype,json,mbstring,pdo. - Apache 2.4 or newer, if you rely on the shipped
.htaccess.
Warning
PHP 5.6 and PHP 7.x are no longer supported, and the minimum version is now PHP 8.1.
If you are still on PHP 7.x, stay on Seed-PHP 1.9.x.
On PHP 8.2+ the App instance is marked with #[\AllowDynamicProperties], so
$app-><helper> keeps working as before and raises no deprecation notice.
The Mysql helper was removed in 2.0.0. Use the Database helper (a PDO wrapper) instead.
Using composer makes it really simple to get started!
If you have a project on going with composer, use:
$ php composer require rogeriotaques/seed-phpor, to start a project from scratch, use:
$ php composer create-project rogeriotaques/seed-phpYour application should have an index.php which may looks like the
following example. Or simply create a new index.php file as follows:
Example: (index.php)
<?php
// include composer autoloader
include __DIR__ . '/vendor/autoload.php';
// initilise the Seed-PHP App class
$app = \SeedPHP\App::getInstance();
// Define a initial route
$app->route('GET /', function () {
echo 'Hello Word!';
});
// Let's rock ...
$app->run();If you have forked or cloned the repository from Github, then instead of include the 'autoload.php' from composer, include the package loader:
// include package loader
include __DIR__ . '/seed-php/loader.php';Now, as a final step, you must create the .htaccess file (in the same folder of the index.php) which will contain the necessary settings for Apache properly use the mod_rewrite and route all the traffic thru index.php.
Example:
# SeedPHP
# © 2026, Abtz Labs. By Rogerio Taques.
# @see http://github.com/rogeriotaques/seed-php
<FilesMatch "^(\.|\_)">
# Deny access to filenames starting
# with dot(.) or underline(_)
Require all denied
</FilesMatch>
<FilesMatch ".(yml|yaml|log|sh)$">
# Deny access to filenames with
# especific extensions
Require all denied
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>Done! Now, you can visit your project on your preferred browser. 😉
This is an open-source project, which means you can also freely contribute to improve it and make it better. To contribute, fork this repository, do your changes or improvements and create a pull request.
Found an issue or would like to suggest something? Just go to this page and open a ticket. Learn more about us.
Sponsoring this project will help and motivate us to keep improving it and making it even better for you (and the whole open-source community) who is using this package. You can sponsor it in several different ways, including donating a monetary amount:
But, if you prefer donate your time instead, please get involved and help with bug fixes, and improvements.
THANK YOU! 🤍