Skip to content
fast, lightweight PHP 5.3 MVC framework
PHP JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
js Fix js lint warnings Mar 19, 2012
lib/Sonic Allow dashes in extension names Feb 26, 2012
tests rename controller method May 3, 2011
LICENSE adding license file Sep 27, 2010 Update code for index.php to latest version Feb 26, 2012


Sonic Framework is a blazing fast PHP 5 MVC framework.


1.1 beta

System Requirements

PHP 5.3+

Recommended Server Requirements

MySQL 5, Memcached

Recommended PHP Extensions

Memcache, APC, PDO

Simple Installation

mkdir sonic && tar xzvf sonic.tar.gz -C sonic && cd sonic
./install /path/to/install/to AppName

Follow instructions in /path/to/install/to/SETUP file

Advanced Installation

  1. Download latest source from: []
  2. Create a directory somewhere where you want the application to live
  3. Within that directory add the sonic library from step 1 and some other directories and files that the app will need.

    You want your application structure to look like this:

    [] = directory
    • = file
    [] application_name
        [] configs
            • app.ini
            • routes.php
        [] controllers
            • main.php
        [] libs
            [] Sonic (downloaded in step 1)
            [] MyApp
        [] public_html
            • .htaccess
            [] assets
                [] css
                [] img
                [] js
            • index.php
        [] views
            [] main
                • index.phtml
                • error.phtml
  4. In /public_html/.htaccess add the following:

    SetEnv ENVIRONMENT development
    RewriteEngine On
    RewriteRule ^.htaccess$ - [F,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule \.*$ /index.php
  5. In /public_html/index.php add the following:

    // make sure to set the timezone if it is not already set in your php.ini
    // date_default_timezone_set('UTC');
    $base_path = str_replace(DIRECTORY_SEPARATOR . 'public_html', '', __DIR__);
    require $base_path . DIRECTORY_SEPARATOR . 'libs' . DIRECTORY_SEPARATOR . 'Sonic' . DIRECTORY_SEPARATOR . 'Core.php';
    $app = Sonic\App::getInstance();
    // if you would like to use an app delegate uncomment this line
    // $app->setDelegate('{MyApp}\App\Delegate');
  6. Setup an apache vhost to point to your /public_html directory with DirectoryIndex set to index.php and add the server name to your /etc/hosts.
  7. That's all there is to it, but your app won't work until you add some controllers and views. For more tutorials visit:
Something went wrong with that request. Please try again.