Write the first CGI program

1. First make sure that yourapache http server starts.



< /span>

The server is not up yet


Start the server



2. Write cgi executable file

#include int cgi_hello_world(){ std::cout<<"Content-type:text/html

"; std::cout< <"
"; std::cout<<"
"; std::cout<<" Hello World -First CGI Program
"; std:: cout<<"
"; std::cout<<"
"; std::cout<<"

Hello World! This is my first CGI program

"; std:: cout<<" "; std::cout<<" "; //std::cout<<" "; return 0;}int main (){ cgi_hello_world(); return 0;}

g++ 1.cpp -o cgi_hello_world -g


copy cgi_hello_world to the cgi-bin directory of the apache server



3. Access


< /span>

Browser input http://192.168.1.211:8080/cgi-bin/cgi_hello_world

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1695 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.