Jump to content

CGI-BIN & CHMOD


slj90

Recommended Posts

Two questions today.

Firstly, what is the cgi-bin used for and when should it be used? Should I put all my PHP scripts in there, for example the code that registers a user? What about HTML pages with PHP on them like the registration form itself?

Secondly, when should I be changing CHMOD settings? Will my hosting service already of set them up correctly or do I need to change settings for certain pages etc.?


​Thanks,

Link to comment
https://forums.phpfreaks.com/topic/294473-cgi-bin-chmod/
Share on other sites

The cgi-bin directory is a bit of a "the old days" thing. It was a location that would be configured to allow scripts or executable to be run via CGI. Files outside this directory typically had to be static or only use server-side-includes. These days you can usually put your scripts anywhere and the cgi-bin is obsolete.

 

As far as chmod, it depends on what you're referencing. Again, in "the old days" your scripts that lived in the cgi-bin needed to have the execute bit set in order to run, so they were typically set to 755. These days this is unnecessary so you would typically just leave them at their default which is usually 664 or 644. You may need to change them for other reasons such as to allow writing to an uploads directory or similar. There are other ways to handle those situations typically as well.

Link to comment
https://forums.phpfreaks.com/topic/294473-cgi-bin-chmod/#findComment-1505275
Share on other sites

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.