I love PHP, and untill now I still use it. Framework has become a trend or a basic necessity in the current era. There are hundreds of PHP framework that can be obtained on the internet and the majority free. One of the popular and very easy to learn and use is CodeIgniter. But unfortunately the EllisLab as maintainer not continue its development so that current can be said CodeIgniter is dead. Although there are many alternative framework that can be used, but in my opinion nothing can replace the simplicity and ease of CodeIgniter. Because I like the simplicity of it I tried to find a framework that is similar to CodeIgniter. And finally I found it, his name is Simple PHP MVC Framework.

Simple PHP MVC Framework is one of the many frameworks are scattered on the internet which I think is very simple, flexible, and extensible. They motto is:

Setup extremely quickly. Clean coding strucuture

In the existing documentation on its official website no guide to install on a web server Nginx, Apache only. But I already like Nginx and currently I manage several servers also been migrated to Nginx. So I did some experiments to be run this framework in Nginx.

Without any further ado here are the Nginx configuration for this framework. No special configuration, you only need to configure Nginx and PHP-FPM as usual.

server {
  listen 80;
  server_name yourdomain.tld;

  access_log /var/www/access.log;
  error_log  /var/www/error.log;

  root   /var/www;
  index  index.php index.html;

  location = /robots.txt {access_log off; log_not_found off;}
  location ~ /\. {deny all; access_log off; log_not_found off;}
  location / {
    try_files $uri $uri/ /index.php$args;
  }

  location ~ \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}

If you say that a configuration similar to the configuration of CodeIgniter, yes, indeed. I’m cheating on CodeIgniter configuration and make some adjustments.

That’s all. Enjoy your web with Simple MVC and Nginx.

Published by Aris Ripandi

My name is Aris Ripandi, a lecturer and indie web app developer who likes to handle complex problems with simple and elegant solutions. I also have interest with WordPress, DevOps and loves to learn new technologies.