Beaglebone lighttpd cgi


I have a Beaglebone with installed the TI Sitara Linux OS.

Im have configure the lighttpd.conf file for to test a cgi program written in C.

I have made a file index.html that call the cgi.

The index.html file is:

First Name:
Last Name:

The file index.html use the POST method for to send the input data to the cgi c program.

I have cross compiled the C program test and put it in the Beaglebone.
I have renamed the bin test crosscompiled program as test.cgi

I have modifed the lighttpd.conf as below:

server.modules = (

server.document-root = “/www/pages/”

server.port = 80

mimetype.assign = (
“.html” => “text/html”,
“.txt” => “text/plain”,
“.jpg” => “image/jpeg”,
“.png” => “image/png”

index-file.names = ( “index.html” )

cgi.assign = (".cgi" => “/usr/bin/php-cgi”)

the problem is when I call the cgi because the POST method don’t work and the c cgi
is executed as a php program.
The browser show a lot of characters…

Can anyone help me about this problem…?
Which is the correct configuration of the Lighttpd for handle the C cgi program?
many thanks in advance