Development Software
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb Site ManagementDevelopment Software

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 2nd, 2012, 04:49 PM
=charlie= =charlie= is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Location: Italy
Posts: 4 =charlie= User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 2 sec
Reputation Power: 0
How can send output of my interpreter to the browser?

Hi, sorry for my english and i hope to post in the right place.

My question is simple (i hope). I had wrote an interpreted line command web language based on C.

I had configured Apache cgi-bin to execute scripts. In the cgi-bin dir, Perl and Python scripts working fine but my own scripts show always this error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


The first line that run the language interpreter I'm sure is correct... what's wrong? What I must to set or send to the browser exactly?

Reply With Quote
  #2  
Old February 2nd, 2012, 09:51 PM
Catacaustic's Avatar
Catacaustic Catacaustic is offline
Code Monkey V. 0.9
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2005
Location: A Land Down Under
Posts: 1,884 Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 14 h 1 m 42 sec
Reputation Power: 1798
What does the error message in the log file say?

For an "Internal Server Error" message it normally means that something isn't configured correctly in the server software, or that the server software doesn't know what you want it to do from your request. Unfortunately that's about all that we can tell you without knowing what the actual error is.

Reply With Quote
  #3  
Old February 3rd, 2012, 04:07 AM
=charlie= =charlie= is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Location: Italy
Posts: 4 =charlie= User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 2 sec
Reputation Power: 0
That's right.

Some more info....

this is the error line in the Apache Log:

[Fri Feb 03 10:54:50 2012] [error] [client 127.0.0.1] malformed header from script. Bad header=ciao: demo.bpl

(I understand something wrong with header but I don't know what and what to pass to...)

This is the first line I use to execute the script:

My lang: #!c:/NEWLANG/compiler.exe
Perl: #!c:/Perl64/bin/perl.exe
Python: #!c:/Python27/python.exe

My script use 1 only line after first one:

Code:
#!c:/NEWLANG/compiler.exe
echo "ciao"


Like web server I use WAMP in localhost with Apache 2.2.11.


Reply With Quote
  #4  
Old February 3rd, 2012, 05:37 AM
=charlie= =charlie= is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Location: Italy
Posts: 4 =charlie= User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 2 sec
Reputation Power: 0
Some other tests....

If I put only this lines in the script:

Code:
#!c:/NEWLANG/compiler.exe

echo "Content-type: text/html"


The error message in the Apache log is:

[Fri Feb 03 12:33:27 2012] [error] [client 127.0.0.1] Premature end of script headers: demo.bpl

... something in missing... what???

Reply With Quote
  #5  
Old February 3rd, 2012, 07:46 AM
=charlie= =charlie= is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Location: Italy
Posts: 4 =charlie= User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 2 sec
Reputation Power: 0
I found the problem!

At the end of my function, inside the compiler, I add only 1 "\n" line feed. I need to add 2 line feed "\n\n" between the "Content type..." and the commands lines of the script (echo).

Now in the compiler I have this:

Code:
printf("\n\n");


at the end of function echo.

This because CGI Content needs an empty line after "Content type..." command ...

ty

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementDevelopment Software > How can send output of my interpreter to the browser?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap