SERVER
CONFIGURATION


TURBOPY needs PHP 5.6 and MongoDB. You are also encouraged to use it with NGINX and PHP-FPM for best performance. If you just want to try out the framework consider the package for windows that can be installed within minutes. This is an example how a configuration in nginx.conf should look like:
server {

  listen 80;
  server_name localhost;
  root /home/www/TURBOPY/pub/;
  index  index.php;

  location / {
    try_files $uri /index.php?$args;
  } 
    
  location ~ \.php$ {
    # WARNING: Make sure to set cgi.fix_pathinfo=0 in php.ini otherwise foo.jpg/file.php 
    # will be executed on foo.jpg!
    fastcgi_pass  backend;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;   
    include       fastcgi_params;
  }

}
HINT: Make sure you have set cig.fix_pathinfo=0 in php.ini for higher security.
Basically all we need is a forwarding requests of non-existent files to index.php so we can use the db for our pages. This is similar to most modern frameworks these days. If you face connection problems on windows the code below probably helps. It configures nginx to run multiple instances. This may become a problem if you work with interfaces that require different simultanious connections. This is the default configuration of the windows environment.
upstream backend {
   server  127.0.0.1:9000  max_fails=1  fail_timeout=10s;
   server  127.0.0.1:9001  max_fails=1  fail_timeout=10s;
   server  127.0.0.1:9002  max_fails=1  fail_timeout=10s;
   server  127.0.0.1:9003  max_fails=1  fail_timeout=10s;
   server  127.0.0.1:9004  max_fails=1  fail_timeout=10s;
   server  127.0.0.1:9005  max_fails=1  fail_timeout=10s;
}
In Apache you can use something like this in order to forward the requests to the index.php:
<Directory /home/www/TURBOPY/pub/>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . index.php [L]
</Directory>
If you need help with setting up your page feel free to contact us.