Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

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 4th, 2002, 11:41 PM
Michael_Bray Michael_Bray is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Sydney, NSW, Australia
Posts: 40 Michael_Bray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to Michael_Bray
Serve C pages from Apache on Win XP.

Hi,

I have Apache 1.3.14 setup on Windows XP and running smoothly. It has Perl and PHP configured to serve pages as well. I want to be able to run C CGI applications from apache, but I am not sure how to configure it. I had an installer setup apache and php and perl etc.

I have the following program written just to test it:

Quote:
#include <stdio.h>

int main()
{

printf("Content-type: text/html\n\n");
printf("Test");
return 0;

}


Any advice on how to get this program running would be appreciated. Thanks in advance.
__________________
Cheers,
Michael Bray

Reply With Quote
  #2  
Old February 5th, 2002, 12:16 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Because you need to compile it.

Reply With Quote
  #3  
Old February 5th, 2002, 12:42 AM
Michael_Bray Michael_Bray is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Sydney, NSW, Australia
Posts: 40 Michael_Bray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to Michael_Bray
I know I have to compile it. I have compiled it, and placed it in the htdocs directory of apache as test.exe

It is not doing anything to the browse. It is not executing... I need to know how to get apache to realise it has to print the output to the browser.

Reply With Quote
  #4  
Old February 5th, 2002, 01:03 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Because htdocs directory by default is not where you should put your cgi scripts into. You need to put it in your cgi-bin. And cgi-bin by default doesn't reside under htdocs.

Reply With Quote
  #5  
Old February 5th, 2002, 01:04 AM
pippo's Avatar
pippo pippo is offline
A PAtCHy sErver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Italy
Posts: 410 pippo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
If you have php why not use something like:

pippo.php
PHP Code:
<?php
passthru
"/path/to/test.exe" );
?>


just some thoughts...
__________________
My article: mod_rewrite: No More Endless Loops!

Reply With Quote
  #6  
Old February 5th, 2002, 01:27 AM
Michael_Bray Michael_Bray is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Sydney, NSW, Australia
Posts: 40 Michael_Bray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to Michael_Bray
Thanks. I can't believe I forgot to place it in the CGI-Bin. I am used to whacking my PHP scripts in the htdocs directory. Bad habit

Reply With Quote
  #7  
Old February 5th, 2002, 01:31 AM
Michael_Bray Michael_Bray is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Sydney, NSW, Australia
Posts: 40 Michael_Bray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to Michael_Bray
I reply to pippo: Executing the C file by itself is quicker then having to execute it from a PHP file. I am eventually wanting to develop high-end CGI applications in C, so I don't want PHP to slow it down

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Serve C pages from Apache on Win XP.


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT