This guide walks you through installing the Marwa Framework in your project.
If you want a complete application instead of integrating the core package into your own structure, use the recommended starter repository: memran/marwa-php.
git clone https://github.com/memran/marwa-php.git
cd marwa-php
composer install
cp .env.example .env
Use the starter if you want:
| Requirement | Version | Notes |
|---|---|---|
| PHP | 8.4+ | Required |
| Composer | 2.0+ | Package manager |
| Web Server | Any | PHP built-in, Nginx, etc. |
| Database | Optional | MySQL, PostgreSQL, or SQLite |
Open your terminal and run:
composer require memran/marwa-framework
This installs the framework and all its dependencies.
Copy the example environment file:
cp .env.example .env
Edit .env to configure your application:
APP_NAME=MyApp
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_DATABASE=database/app.sqlite
CACHE_DRIVER=file
SESSION_DRIVER=file
Run the console command to verify:
php marwa
You should see a list of available commands:
Console Application
Usage:
command [options] [arguments]
Options:
-h, --help Display help
-V, --version Display version
--env[=ENV] The environment
-q, --quiet Do not output any message
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
-v|vv|vvv, --verbose Increase verbosity
Available commands:
about Display the framework version
db Database management commands
make:command Create a new command class
make:controller Create a new controller class
make:seeder Create a new seeder class
...
Ensure the following directories are writable:
chmod -R 775 storage/
chmod -R 775 bootstrap/cache/
php -S localhost:8000 -t public
Then visit http://localhost:8000
Configure your server block:
server {
listen 80;
server_name myapp.test;
root /path/to/myapp/public;
index index.php;
location / {
try_files $uri /index.php?$query_string;
}
location ~ \\.php$ {
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
}
Ensure .htaccess in public/ is enabled:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
If using a database, create the database file:
# For SQLite
touch database/app.sqlite
chmod 775 database/app.sqlite
# Run migrations (if using marwa-db)
php marwa migrate
Run:
composer dump-autoload
Fix ownership:
# Linux
sudo chown -R www-data:www-data storage/ bootstrap/cache/
If Xdebug is installed, disable it for better performance:
; php.ini
xdebug.mode=off