Forum Discussion
Altera_Forum
Honored Contributor
21 years agoBOA CGI problem hasn't been fixed
This days i try to complete the CGI function in the uClinux BOA of my 1s10 board,but no results.
And wanna achieve the ledcontrol (http://www.niosforum.com/forum/index.php?act=st&f=18&t=2185) via the cgi function on boa. I have tried different ways. >1:index.html //add to home/httpd folder. follow what KEN's method, change "POST" to "GET":
<html>
<head>
<title>CGI script test</title>
</head>
<body>
<form method="get" action="http://202.112.147.82/cgi-bin/test.cgi">
<input type="submit" value="ok">
</form>
</body>
</html> >2:creat test.cgi //add to home/httpd/cgi-bin folder. one way: ## cgi-bin/test.cgi#
# ! /bin/sh
echo "Content-type: text/html\n\n"
echo
echo "The cgi script is working\n" another way://Compile to test.exe,then add test.exe to home/httpd/cgi-bin folder. #include <stdio.h>
void main(void)
{
printf("content-type: text/html\n");
printf("\n");
printf("the cgi script is working\n);
exit(0);
} Unfortunately,error in IE browser: the page cannot be displayed,server inner error... Also i browsered the concerning topic, just like the TOPIC:"How to use boa?" by sunclever. No result to find,even i follow the same way, but no success. Any help would be greatly appreciated! Thank you very much! Best regards! Justin12 Replies
- Altera_Forum
Honored Contributor
Hi schaney,
> nope. It can't recognize echo. Any idea why the script wouldn't work? This sounds weird ... I ran the following script without any problems:
Here are a few things to check: 1. Try the following command: $ echo $PATH If this doesn't work ... you're probably missing 'echo'. 2. Check your PATH environment If the PATH env var doesn't include the directory where echo actually is, you'll either need to add the full path to your script, or setup PATH in your /etc/rc file. Or from the command line: $ export PATH=$PATH:<path to echo> Then try running the script again. Regards, --Scott#!/bin/sh echo "Content-type:text/html\n\n" echo "The cgi script is working\n" - Altera_Forum
Honored Contributor
That would be the problem. I didn't have the sh utilities built into the filesystem.
Thanks, Scott