When I tried to execute CGI, it gives me only plain text.
I installed PHP5.3.11 with apache2 All of them were installed manually from source code, not from apt-get
## Apache2
./configure --prefix/=usr/loca/apache2
make
make install
## php5
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs
make
make test
make install
The above are commands that I used to install apache2 and php5. I guess my installation for apache2 and php5 is correct, since I can run php code on my server. So I tried to execute CGI script after properly, I guess, setting a configuration. However it shows only plain text of CGI script.
###Start###
#!/usr/bin/perl -w
print "Content-type: text/html\r\n\r\n";
print "Hello there!<br />\nJust testing .<br />\n";
for ($i=0; $i<10; $i++){
print $i."<br />";
}
###End###
perl is properly installed at /usr/bin/perl.
I set my httpd.conf like below.
<Directory "/usr/local/apache2/cgi-bin">
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Require all granted
</Directory>
I think cgi-php5 is installed correctly as well, since when I execute "php-cgi -h", it gives me a result. And when I open phpinfo() through browser, GATEWAY_INTERFACE is set to CGI/1.1
Any thing I am missing? I appreciate for your help.