View Full Version : PHP and CGI

05-11-2009, 10:33 PM

I am working on a simple CMS that will be placed in the cgi-bin directory. I am running into issues; the script doesn't work, etc. I have done some searching around the web and plenty of places are saying that php can be executed within the cgi-bin directory, but I am having trouble figuring out how to make it work. I have seen plenty of messages about a cgi-php.ini and php.cgi...

Can somebody help me out?

I am writing this into a pre-existing form registration system that allows people to view certain content. I would like to add in a simple cms that will allow the admins to create a heading, simple description paragraph and upload a PDF file into a folder and place the link. Very simple, but it doesn't work in the cgi-bin. It seems to reference a start.cgi and a htmlos.cgi file...


05-12-2009, 01:18 AM
You can run PHP scripts in your main directory or any "other" directory.

The "cgi-bin" has usually been associated with the Perl programming language ...
that's where you're hearing about that. People call it "CGI", but they actually
mean Perl. CGI (common gateway interface) is not a programming language.

So, although Perl is a tremendous (and powerful) programming language, more
people are using PHP for the simple reason that it can be run in any of the other
directories, is easier to learn than Perl, works well with MySQL, and has a ton of
online support ... for those willing to learn it themselves.

Maybe you can elaborate on why your PHP script has to run in the "cgi-bin" directory.
Or, perhaps you didn't try any PHP test scripts in your other directories?

I would say, leave the "cgi-bin" directory alone, unless you're working
with Perl scripting ... and maybe that's what is causing your confusion?


05-12-2009, 04:02 AM
Thanks for your help.

I know all that you have said.

The reason why I was planning on using php within the cgi folder is that my clients already have a login/authetication scripting installed, plus there is a encryption script that turns the address into numbers based on sessions, so that it bcomes semi-secure. I figured I can just add a simple php cms within this as an added feature.

Oh well. Off to building a whole new solution.