Forum

Using Twig on Hiawatha

Ofir
28 August 2018, 09:58
Hi.
Is there a way to use Twig framework on Hiawatha?
If not do you have some alternative suggestions for Twig?
Hugo Leisink
28 August 2018, 10:44
Sure, why not? Have you given it a try yet?
Ofir
28 August 2018, 12:10
Hi Hugo.
Yes, I tried, but when i try to open my project (very simple Hello world project), the browser tell me that i'm trying to open a bin file and a download dialog is opened.
I tried the same project with Apache and its opened it.

I used this simple hello world example:
https://gist.github.com/inanimatt/4352331

my controller is called "index.php" (located at /var/www/hello_world/web), the template is called "index.html", (located at /var/www/hello_world/templates).

I config the hiawath.conf as follow:
WebsiteRoot = /var/www/hello_world/web
StartFile = index.php

If i change the WebsiteRoot to point to /var/www/hello_world/templates, and i change the StartFile to be my template file, its opened the template file just fine, but again its a static html page.

I probably missing something.
Ofir
28 August 2018, 16:25
I have done some simple check. the problem is not related to the Twig framework, its more basic. I try to open simple php file and got the same result, download dialog for a bin file. I probably doing something wrong...
Ofir
28 August 2018, 16:37
Ok, found the problem...
https://www.hiawatha-webserver.org/howto/cgi_and_fastcgi

Look like its working.
Hugo Leisink
28 August 2018, 19:30
Well done.
This topic has been closed.