Jump to content

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

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.