accessing CGI-BIN / odd script behaviour

Discussion in 'Installation/Configuration' started by jamesls, Aug 2, 2009.

  1. jamesls

    jamesls New Member

    I have a script that works fine when I run it on my debug machine but when I upload it to my ispconfig machine I have problems accessing it.

    I'm running ubuntu 8.10 & ispconfig 3

    The script is a PHP script, and is in my cgi-bin folder.
    The script will run ok if its run at the start of the web page.
    if I place the script in a form action it can't find the script.

    The web layout is the default ispconfig, I use 'include "../cgi-bin/script.php" '
    at the start of the page, (it sets up sessions) it'll work fine with no problems.

    I place the same ../cgi-bin/script.php in a forms action and it gives me an error - page not found.

    I've commented out everything within the script apart from a page redirect
    header (Location: ../page02.php )

    if I put the script in the same folder as the web pages (web) it all works fine.
    I've tried various paths and the ../cgi-bin/script.php works at the top of a page but not if I put it in a form action.

    It will work in the form action if I place it in the same folder as the web pages and change the form action /script.php.

    Am I address the cgi-bin folder correctly?
    The read, write, exeute for the cgi-bin folder & web folder appear to be the same.

    I'm puzzled as to why it won't work when I call the script from a form if the script is in the cgi-bin folder.

    Any help would be apreciated

    james
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The cgi-bin folder is for perl or shell scripts and not for PHP scripts. PHP scripts are no cgi scripts have to be in the normal web folder.
     
  3. jamesls

    jamesls New Member

    Hi Till

    I wanted to put it in the cgi-bin directory so that it was not easy for people to look at.
    I finaly got it to work using the path /cgi-bin/script.php.

    It seems to be working ok

    Is there a good reason not to place my scripts in cgi-bin.

    Is there a way of putting the scripts in a folder that can not be downloaded or viewed from the internet.
     

Share This Page