Jump to content

using php scripts in a cgi-bin


dbillings

Recommended Posts

Howdy, I'm trying to execute a script in a cgi-bin directory, and I'm not having any luck.

I'm using wamp and my cgi-bin is located at

 

c:/wamp/Apache2/cgi-bin

 

I've never done this before and I'm not trying anything fancy just...

 

#!C:\wamp\php\php-cgi
##
##  printenv -- demo CGI program which just prints its environment
##

print "Content-type: text/plain; charset=iso-8859-1\n\n";

<?php

echo "Hello World!";

?>

 

No luck at all yet, any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/64470-using-php-scripts-in-a-cgi-bin/
Share on other sites

Here's a few questions I'd like to throw out there.

 

1. Would my php files need to be named file.php or file.cgi to be executed out of a cgi-bin?

2. I've managed to get the php extension files to print in a browser but the Shebang line prints as text for some reason, why?

3. I assume I want the shebang line to point to c:\wamp\php\php-cgi there is also a php.exe and php-win.exe but I assume the php-cgi is the correct one *shrug*?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.