CGI Scripts: Error 500: Internal Server Error CGI program sent malformed HTTP headers: [] ??

1,124 views
Skip to first unread message

gforums

unread,
Sep 2, 2010, 7:51:15 PM9/2/10
to mongoose-users
Hi there,

I am new to mongoose and have no experience with it yet.
I've set up the webserver on a linux running embedded device and it's
working so far.
(port 80, standard settings). The cgi-files are located in the root-
directory from mongoose.

Now I am trying to get CGI(with html output) to work, but everytime I
try to open my cgi files (using firefox), I get the following message:

>> Error 500: Internal Server Error
>> CGI program sent malformed HTTP headers: []

AS CGI-Interpreter, I am using /bin/ash and the first lines of my cgi
files are looking like this:

#! /bin/ash
echo -e "Content-Type: text/html\n\r\r"
echo -e "Hello World"
....
....

Did I miss something? Could anyone provide me with a very short CGI
content, that should work with mongoose?

Thanks for all your hints!
Best,
gforums

Sergey Lyubka

unread,
Sep 2, 2010, 10:44:09 PM9/2/10
to mongoos...@googlegroups.com
Write CGI like this:

#! /bin/ash
echo "Content-Type: text/html"
echo
echo "Hello World"



--
You received this message because you are subscribed to the Google Groups "mongoose-users" group.
To post to this group, send email to mongoos...@googlegroups.com.
To unsubscribe from this group, send email to mongoose-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongoose-users?hl=en.


gforums

unread,
Sep 3, 2010, 3:38:08 AM9/3/10
to mongoose-users
Thanks, Sergey,
copied your example - but this isn't working for me.
Still exaclty the same message...

On 3 Sep., 04:44, Sergey Lyubka <vale...@gmail.com> wrote:
> Write CGI like this:
>
> #! /bin/ash
> echo "Content-Type: text/html"
> echo
> echo "Hello World"
>
> > mongoose-user...@googlegroups.com<mongoose-users%2Bunsu...@googlegroups.com>
> > .

Sergey Lyubka

unread,
Sep 3, 2010, 4:15:36 AM9/3/10
to mongoos...@googlegroups.com
Try to execute this script by hands.

To unsubscribe from this group, send email to mongoose-user...@googlegroups.com.

gforums

unread,
Sep 3, 2010, 4:25:24 AM9/3/10
to mongoose-users
ooh sorry...
my fault :-)
didn't chmod a+x the cgi files.

Now it's working!!

thank you

On 3 Sep., 10:15, Sergey Lyubka <vale...@gmail.com> wrote:
> Try to execute this script by hands.
>
> > <mongoose-users%2Bunsu...@googlegroups.com<mongoose-users%252Buns...@googlegroups.com>

mxn

unread,
Sep 24, 2013, 10:04:42 PM9/24/13
to mongoos...@googlegroups.com
Sergey

I am new to trying to run a test.py script using mongoose-3.7. Test.py runs fine from teh command line.Test.py contents are
print ("Content-Type: text/html")
print ("\r\n")
print ("\r\n")

When i run it using Python from the command line, it runs without errors.

When i try to run it from within a client side html script using "Action:cgi_bin/Test.py" it errors out with

Error 500: Internal Server Error
CGI program sent malformed or too big (>16384 bytes) HTTP headers: []

Help!

Sergey Lyubka

unread,
Sep 25, 2013, 1:53:42 AM9/25/13
to mongoose-users
Run it like this from command line (I am assuming you're using UNIX):

./Test.py | hexdump -C

And paste the output here.


To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-user...@googlegroups.com.

To post to this group, send email to mongoos...@googlegroups.com.

mxn

unread,
Sep 25, 2013, 7:19:03 PM9/25/13
to mongoos...@googlegroups.com
I am using Windows 8. What would you like me to run?
Reply all
Reply to author
Forward
0 new messages