PHPackages                             fobiaweb/slim - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. fobiaweb/slim

ActiveLibrary[HTTP &amp; Networking](/categories/http)

fobiaweb/slim
=============

Slim Framework, a PHP micro framework

3.0.2(11y ago)01992MITPHPPHP &gt;=5.3.0

Since Mar 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/fobiaweb/Slim)[ Packagist](https://packagist.org/packages/fobiaweb/slim)[ Docs](http://github.com/codeguy/Slim)[ RSS](/packages/fobiaweb-slim/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (3)Versions (8)Used By (0)

Slim Framework
==============

[](#slim-framework)

[![Build Status](https://camo.githubusercontent.com/bd5e76697711716891ef2f033849049981616fd5a61da7b354299de429c943e4/68747470733a2f2f7472617669732d63692e6f72672f666f6269617765622f536c696d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fobiaweb/Slim)Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs. Slim is easy to use for both beginners and professionals. Slim favors cleanliness over terseness and common cases over edge cases. Its interface is simple, intuitive, and extensively documented — both online and in the code itself. Thank you for choosing the Slim Framework for your next project. I think you're going to love it.

Features
--------

[](#features)

- Powerful router
    - Standard and custom HTTP methods
    - Route parameters with wildcards and conditions
    - Route redirect, halt, and pass
    - Route middleware
- Resource Locator and DI container
- Template rendering with custom views
- Flash messages
- Secure cookies with AES-256 encryption
- HTTP caching
- Logging with custom log writers
- Error handling and debugging
- Middleware and hook architecture
- Simple configuration

Getting Started
---------------

[](#getting-started)

### Install

[](#install)

You may install the Slim Framework with Composer (recommended) or manually.

[Read how to install Slim](http://docs.slimframework.com/#Installation)

### System Requirements

[](#system-requirements)

You need **PHP &gt;= 5.3.0**. If you use encrypted cookies, you'll also need the `mcrypt` extension.

### Hello World Tutorial

[](#hello-world-tutorial)

Instantiate a Slim application:

```
$app = new \Slim\App();

```

Define a HTTP GET route:

```
$app->get('/hello/:name', function ($name) {
    echo "Hello, $name";
});

```

Run the Slim application:

```
$app->run();

```

### Setup your web server

[](#setup-your-web-server)

#### Apache

[](#apache)

Ensure the `.htaccess` and `index.php` files are in the same public-accessible directory. The `.htaccess` file should contain this code:

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

```

Additionally, make sure your virtual host is configured with the AllowOverride option so that the .htaccess rewrite rules can be used:

AllowOverride All

#### Nginx

[](#nginx)

The nginx configuration file should contain this code (along with other settings you may need) in your `location` block:

```
try_files $uri $uri/ /index.php?$args;

```

This assumes that Slim's `index.php` is in the root folder of your project (www root).

#### HipHop Virtual Machine for PHP

[](#hiphop-virtual-machine-for-php)

Your HipHop Virtual Machine configuration file should contain this code (along with other settings you may need). Be sure you change the `ServerRoot` setting to point to your Slim app's document root directory.

```
Server {
    SourceRoot = /path/to/public/directory
}

ServerVariables {
    SCRIPT_NAME = /index.php
}

VirtualHost {
    * {
        Pattern = .*
        RewriteRules {
                * {
                        pattern = ^(.*)$
                        to = index.php/$1
                        qsa = true
                }
        }
    }
}

```

#### lighttpd

[](#lighttpd)

Your lighttpd configuration file should contain this code (along with other settings you may need). This code requires lighttpd &gt;= 1.4.24.

```
url.rewrite-if-not-file = ("(.*)" => "/index.php/$0")

```

This assumes that Slim's `index.php` is in the root folder of your project (www root).

#### IIS

[](#iis)

Ensure the `Web.config` and `index.php` files are in the same public-accessible directory. The `Web.config` file should contain this code:

```

```

Documentation
-------------

[](#documentation)

Author
------

[](#author)

The Slim Framework is created and maintained by [Josh Lockhart](http://www.joshlockhart.com). Josh is a senior web developer at [New Media Campaigns](http://www.newmediacampaigns.com/). Josh also created and maintains [PHP: The Right Way](http://www.phptherightway.com/), a popular movement in the PHP community to introduce new PHP programmers to best practices and good information.

License
-------

[](#license)

The Slim Framework is released under the MIT public license.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Total

5

Last Release

4302d ago

Major Versions

2.4.2 → 3.0.0-RC12014-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/8872d9ec77d4990b20dbde810f239399118d6c11daadd4da833dcb15f7f7621c?d=identicon)[fobia](/maintainers/fobia)

---

Top Contributors

[![tyurind](https://avatars.githubusercontent.com/u/2355982?v=4)](https://github.com/tyurind "tyurind (11 commits)")

---

Tags

restroutermicroframework

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fobiaweb-slim/health.svg)

```
[![Health](https://phpackages.com/badges/fobiaweb-slim/health.svg)](https://phpackages.com/packages/fobiaweb-slim)
```

###  Alternatives

[lukasdev/drouter

Um sistema simplista de roteamento, com o intuito de ser utilizado em aplicacoes web pequenas e webservices REST

172.6k](/packages/lukasdev-drouter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
