0

I created a c program and want to compile it to cgi. However, after compilation, the executable file is a binary file and cannot run on browser. How can I solve this problem? My OS is window 10 and the c compiler is Code Blocks.

Jackson
  • 11
  • What else should a C program be compiled to? Every C program is used to create a binary. Is your webserver running on Windows 10? – Gerhardh Feb 12 '19 at 06:36

1 Answers1

3

CGI programs do not run in your browser. They run on the web server. They have to be compiled with compiler that targets the environment on the web server, and the server has to be configured to be willing to run them rather than serving them as data files.

R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711
  • I want to ask why the executable file is a binary file and cannot run on web server – Jackson Feb 12 '19 at 04:36
  • then the answer is that it can... but maybe not on the server you have. – Jasen Feb 12 '19 at 07:10
  • 1
    @Jackson your question states web _browser_, not server. There is a huge difference. You did not specify what web _server_ you are attempting to run this CGI program in, or how the server is configured. I have to assume that you don't understand the difference. – paddy Feb 12 '19 at 07:24