statescua/plaut

A lightweight MVC framework for newbies that use LAMP stack

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:framework

1.2.3 2021-05-21 04:58 UTC

This package is not auto-updated.

Last update: 2024-12-14 20:02:27 UTC


README

Lightweight Model-View-Controller Micro PHP Framwork built for newbies who use a LAMP stack. Replit: https://plaut.thinkphp.repl.co/

Install

  • composer create-project --prefer-dist statescua/plaut php-mvc
  • cd php-mvc
  • php -S 0.0.0.0:8080
  • Then go to browser: http://localhost:8080

Requirements

  • PHP 7.0 or greater
  • MySQL 4.1.2 or greater
  • The mod_rewrite Apache module

MOD_REWRITE Apache2

In order for Apache to understand rewrite rules, we first need to activate mod_rewrite. It’s already installed, but it’s disabled on a default Apache installation. Use the a2enmod command to enable the module.

sudo a2enmod rewrite
sudo nano /etc/apache2/sites-available/000-default.conf
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
sudo systemctl restart apache2
sudo nano /var/www/html/.htaccess

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

# Prevent file browsing
Options -Indexes

Proof: