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
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*?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.