1. Issue:
I have installed Apache (see the referenced phpinfo output for more details) and I am trying to demonstrate C++ scripting with a "Hello Word" example. This is mostly a setup issue.
Once 64-bit Apache is installed, what else needs to be done to get C++ scripting to work? Is that done in the php framework?
-A small program for instance could be created as a cgi script that would just run the compiler and run the output generated as an interpreter of sorts.
-But with PHP, it is possible to just load the .dll; why not also with C++?
I like C++ because of the way that it is possible to organize the code;
-I like the hierarchical structure better; it seems more flexible
-Also, it is easier to translate between paper documents and C++ code
2. Probing
-I tried to find references to the issue; I remember reading material before that seemed to suggest that it might be possible directly.
-From GCI, it seems that it is possible to compile the programs as modules that can load into Apache directly
3. Analysis
-I am not finding the direct approach for a C++ interpreter that would work like PHP; however the indirect approach of compile and run might be possible
-The workaround would be to build the CGI interface in C++ and compile it and then run it.
4. Isolation
-I am trying to see if Cygwin would work with its language package following:
Cygwin - Part Two - Installing GCC[
1]
and also following
Cygwin - Part Three - Testing the GCC C++ Compiler[
2]
and most importantly "Introduction to C++ CGI":
Introduction to C++ CGI | Guy Rutenberg[
4]
See the references for more detail (and additional perhaps related information).
4. Resolution
No resolution yet; Is there a C++ interpreter available? Or does the software need to be written in C++ again (I guess to use the Cygwin compiler from windows to take a given code, save it, and then compile it and run it, or the equivalent under Windows or other operating systems.)
6.1 References - attempted research to resolve the issue
40. http:
http:
41. phpinfo()
http:
42. test.php -Google
43. PHP: Your first PHP-enabled page - Manual
http:
47. 2016-02-03T10:46:34+00:00-phpinfo().pdf
http:
48. c++ scripting with php -Google
49. execute c++ program with php script - Stack Overflow
http:
50. Run C++ script in PHP - Stack Overflow
http:
51. Calling a PHP script from a C++ Program - Stack Overflow
http:
52. interpreted c++ running under php - Google
https:
53. c++ to php compiler - Google
54. c++ to php compiler - Google
55. Compile and Execute C++ Online
http:
56. writing a script interpreting module for Apache -Google
57. Apache Tutorial: Dynamic Content with CGI - Apache HTTP Server Version 2.2
https:
58. Writing Apache Modules with Perl and C: The Apache API and Mod_perl - Lincoln Stein, Doug MacEachern - Google ספרים
https:
59. CgiScripts - Python Wiki
https:
60. CGI -Google
https:
61. Apache Tutorial: Dynamic Content with CGI - Apache HTTP Server Version 2.2
https:
62. Writing CGI programs for Windows 7.1 -Google
63. CGI Programming With Apache and Perl on Windows XP
http:
64. writing a c++ windows cgi program for apache -Google
65. The Megalomaniac Bore: C++ based CGI with Apache on Win32 & Linux
http:
66. How to config apache for C++ CGI scripts? - Stack Overflow
http:
67. A Short Guide to writing server-side CGI programs in C++ - Wikiid
http:
68. C++ Web Programming
http:
69. HOW-TO Write a CGI Program in C/C++
http:
70. Introduction to C++ CGI | Guy Rutenberg
https:
71. Code::Blocks download | SourceForge.net
http:
72. c++ compiler for code blocks -Google
73. Installing a supported compiler - CodeBlocks
http:
74. Borlad C++ - חיפוש ב-Google
https:
75. Download Borland C++ Compiler For Free - The Crazy Programmer
http:
76. GCC Compiler: Download Code::Blocks 12.11 a Free C/C++ IDE - The Crazy Programmer
http:
77. download GCC for windows -Google
78. Mingw-w64 - GCC for Windows 64 & 32 bits [mingw-w64]
http:
79. Win-builds [mingw-w64]
http:
80. Intel C/C++ Compiler for Wndows 7 - חיפוש ב-Google
https:
81. Installing a supported compiler - CodeBlocks
http:
82. Cygwin
http:
84. Intel C++ compiler in windows 7 64 bits
https:
85. Intel C++ Compiler 11.1.067 (free) - Download latest version in English on phpnuke
https:
87. how to use cygwin C++ compiler -Google
88. Cygwin - Part Three - Testing the GCC C++ Compiler
http:
90. Cygwin - Part Two - Installing GCC
http:
91. libusb-win32 download | SourceForge.net
http:
6.2 References part 2:
From Send Tab URLs (31 links)
1. How can I demonstrate C++ scripting via the web with Apache and Windows 7.1 64-bit? - CodeProject
http:
2. Cygwin - Part Three - Testing the GCC C++ Compiler
http:
3. Introduction to C++ CGI | Guy Rutenberg
https:
4. Introduction to C++ CGI – Processing Forms | Guy Rutenberg
http:
5. Introduction to C++ CGI | Guy Rutenberg
http:
6. 404 Not Found
http:
7. c++ CGI - חיפוש ב-Google
https:
8. C++ Web Programming
http:
9. 500 Internal Server Error
http:
10. Hello World - First CGI Program
http:
11. Index of ftp:
ftp:
12. ftp:
ftp:
13. 404 Not Found
http:
14. apache server log - חיפוש ב-Google
https:
15. Log Files - Apache HTTP Server
https:
16. apache error End of script output before headers - חיפוש ב-Google
https:
17. perl - "End of script output before headers" error in Apache - Stack Overflow
http:
18. 500 Internal Server Error
http:
19. .pl #! cgi path to perl windows - חיפוש ב-Google
https:
20. Configuring the Apache Web Server to Run Perl Programs on Windows
http:
21. Setting up Perl/CGI with Windows
http:
22. How to install Perl on Windows | ricocheting.com
http:
23. How can I set Perl's inclusion path for modules for a CGI script? - Stack Overflow
http://stackoverflow.com/questions/355267/how-can-i-set-perls-inclusion-path-for-modules-for-a-cgi-script
24. how to restart the apache server httpd - חיפוש ב-Google
https://www.google.co.il/search?q=how+to+restart+the+apache+server+httpd&ie=utf-8&oe=utf-8&gws_rd=cr&ei=2xCyVoWlGoaAPK6tkdAP
25. Start / Stop and Restart Apache 2 Web Server Command
http://www.cyberciti.biz/faq/star-stop-restart-apache2-webserver/
26. Problem loading page
http://localhost/
27. perl for windows 7 64 bit apache - חיפוש ב-Google
https://www.google.co.il/search?q=perl+for+windows+7+64+bit+apache&ie=utf-8&oe=utf-8&gws_rd=cr&ei=TxKyVvnYCYOAU5LotdgP#q=perl+for+windows+7+64+bit+apache&start=10
28. How to install Perl on Windows | ricocheting.com
http://www.ricocheting.com/how-to-install-on-windows/perl
29. Thank you for downloading ActivePerl | ActiveState Software
http://www.activestate.com/activeperl/downloads/thank-you?dl=http://downloads.activestate.com/ActivePerl/releases/5.22.1.2201/ActivePerl-5.22.1.2201-MSWin32-x64-299574.msi
30. CGI #!/path/to/perl windows example - חיפוש ב-Google
https://www.google.co.il/search?q=%23!/path/to/perl+example&ie=utf-8&oe=utf-8&gws_rd=cr&ei=sxOyVpWIMozSUZmmhNgJ#q=CGI+%23!%2Fpath%2Fto%2Fperl+windows+example
31. apache - How to run perl files over xampp in windows? - Stack Overflow
http://stackoverflow.com/questions/7860380/how-to-run-perl-files-over-xampp-in-windows
6.3 References Part 3
5. c++ cgi scripting - Google Search
6. cgicc: A Tutorial Example
http:
7. cgicc:
http:
8. cgicc for windows 7 - Google Search
9. gnu cgi (cgicc) does not compile with gcc on Windows using MinGW/Cygwin - Stack Overflow
http:
10. Cgicc - Free Software Directory
https:
Update #1:
I found a sample file printenv.pl and I modified that slightly (changing the header), after checking the error logs for Apache. The new code is:
use strict;
use warnings;
print "Content-type: text/plain; charset=iso-8859-1\n\n";
foreach my $var (sort(keys(%ENV))) {
my $val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}