Total newbie, can't get it to run (3.6)

51 views
Skip to first unread message

Peter Hecht

unread,
Mar 27, 2018, 3:31:45 PM3/27/18
to Fat-Free Framework
I have take a download from fat free and put it here: /var/www/html/fatfree-master 

When I go to 

I get: 
[Tue Mar 27 13:15:20.599070 2018] [:error] [pid 17510] [client ::1:46070] [fatfree-master/lib/base.php:1660] Base->error()
[Tue Mar 27 13:15:20.599106 2018] [:error] [pid 17510] [client ::1:46070] [fatfree-master/index.php:87] Base->run()
 in my log.
It seems something is wrong.  I have this as the index.php:
<?php
$f3 = require('lib/base.php');
$f3->route('GET /',
    function() {
        echo 'Hello, world!';
    }
);
$f3->run();
?>

What do I need to do to get this to work?  I have Ubuntu 16.04 patched.  I have php7.2:
PHP 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar  6 2018 11:18:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.3-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Not saying I'm a great web developer, but I can't get this to work. 

richgoldmd

unread,
Mar 27, 2018, 3:48:36 PM3/27/18
to Fat-Free Framework
It's the index.php in the url that is messing it up - Can you access at http://localhost/fatfree-master/ ?

You should have the web server set up to use index.php as the default document. Also make sure you set up the rewrite (use the .htaccess file for apache, etc) to handle paths other than /

Peter Hecht

unread,
Mar 27, 2018, 4:03:08 PM3/27/18
to Fat-Free Framework
I can get to http://localhost/fatfree-master/ and get the "Hello, world!" but even when I add "DirectoryIndex index.php" to the top of the fatfree-master/.htaccess, I can not get http://localhost/fatfree-master/index.php to work. 

Here is the fatfree-master .htaccess. :
DirectoryIndex index.php
# Enable rewrite engine and route requests to framework
RewriteEngine On

# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing this .htaccess file
#
RewriteBase /fatfree-master/

RewriteRule ^(tmp)\/|\.ini$ - [R=404]

RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

Thanks for replying so quickly!!

richgoldmd

unread,
Mar 27, 2018, 4:06:18 PM3/27/18
to Fat-Free Framework
You wont ever access this page as index.php - F3 expects the rewrite to be there so your patsh are the portion before the index.php plius whatver path you specify in your route. So in you case:

GET / - would route from http://localhost/fatfree-master/
GET /myPage would route from http://localhost/fatfree-master/myPage 
etc

The index.php is and remains hidden

Peter Hecht

unread,
Mar 27, 2018, 4:17:56 PM3/27/18
to Fat-Free Framework
Nice to know.  Now I can move on! Thanks!!!
Reply all
Reply to author
Forward
0 new messages