I just started trying to use the fat-free framework. I don't understand what i am doing wrong here. I have the following code that i got from their site:
$f3 = require('/var/tmp/fatfree-master/lib/base.php');
$f3->route('GET /',
function() {
echo 'Hello, world!';
}
);
$f3->run();
?>
When i run the following code using the cli, like this php index.php it works fine. But when i try to go to it with a browser i get the following error:
Not Found
HTTP 404 (GET /index.php)
I don't understand how it works through cli and not through a browser. Anyone come across this before?
Forget everything about any PHP files in your URL. You don't need them and you don't use them in any URL. So, just open
example.org/
instead ofexample.org/index.php
and it will work.Also make sure, as mentioned by Ben in the comments, to configure .htaccess properly as described here: https://github.com/bcosca/fatfree#sample-apache-configuration