Getting started with MAMP/WAMP
Hi there! I wanted to run frameworkless without docker or vagrant, by using good ol' MAMP and looks like I succeeded. Here is what I had to do, maybe someone will find it useful.
Edit base.html.twig to look for CSS in the right place:
<link rel="stylesheet" href="../public/assets/css/style.css">
Create a .htaccess in root directory and add:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /public/
RewriteCond %{REQUEST_URI} !/public [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
Oops, not working. Looks like .htaccess overrides are disabled.
In /Applications/MAMP/conf/apache/httpd.conf find this:
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
...and replace with
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
Now, I'm wondering if there is a simpler way of doing this and is it possible that somewhere down the road this might interfere with router somehow?
From what I can tell it looks like your document root is set to be the root directory of the cloned repository instead of the public subdirectory, which is pretty risky.
For example, if I changed this line in the example nginx configuration (https://github.com/mmeyer724/Frameworkless/blob/master/misc/config/nginx/vagrant.conf#L15):
location ~ \.php$ {
to
location ~ \.meat$ {
nginx would happily start serving up my .php scripts as plaintext instead of executing them.
When your document root is set to public, the only file at risk in this case is index.php (which only contains a single line of code) -- instead of the entire application.
Note: I haven't used apache in a quite a while, so there's a decent chance I misread the .htaccess.