Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/annimon-tutorials/php-unframework-template

Framework-less template for simple sites. Source code for tutorial
https://github.com/annimon-tutorials/php-unframework-template

fastroute framework-less php tutorial twig

Last synced: 1 day ago
JSON representation

Framework-less template for simple sites. Source code for tutorial

Awesome Lists containing this project

README

        

# php unframework template

Fast and lightweight framework-less template for simple sites. Uses [FastRoute](https://github.com/nikic/FastRoute), [Twig](https://twig.symfony.com/) and [Pimple](https://pimple.symfony.com/).

Demo: https://projects.annimon.com/

## Requirements

php 7.4+

## Install

```bash
composer install
chmod -R 777 cache
cd src && npm install
npm run dist
```

Nginx config

```nginx
server {
listen 80;
listen [::]:80;
listen 443 ssl;

root /var/www/app/public;
index index.php index.html index.htm;
server_name app.site;
autoindex off;

location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~* ^.+\.(svg|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {
access_log off;
expires 30d;
}
}
```

Apache config

```xml

ServerName app.site
ServerAdmin [email protected]
DocumentRoot /var/www/app/public


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted

```