Results 1 to 7 of 7

Thread: cgi-bin Script errors

  1. #1

    Default cgi-bin Script errors


    I have recently moved my Dedicated Hosting to a company that uses Plesk, which I find works excellent for me.

    However, I am having problems installing CGI Scripts. The permissions for the scripts are set correctly, but I receive "500 Internal Server Error" messages when I try and run the cgi installation scripts.

    The cgi-bin has permissions of 750 (rwxr-x---), with the Owner set as 'Domain FTP User', and Group set as 'psaserv'.

    The scripts have permissions of 755 (rwxr-xr-x), with the Owner set as 'Domain FTP User', and Group set as 'psacln'.

    I have 2 questions:
    1. How can I get the scripts to work correctly without receiving Internal Server Error messages? Am I installing something incorrectly?

    2. I am installing the scripts into the root level cgi-bin folder that Plesk created when I set up the Domains. My Hosting company suggested I create a new cgi-bin in 'httpdocs' folder. Which folder should I be using?

    Any help and advice would be very much appreciated.


  2. #2


    You are using the correct directory. I too have had problems with getting scripts working in the cgi-bin directory. The only fix I have found is to enter "-w" after the shebang as such:

    #!/usr/bin/perl -w

    I still would like to know why this is necessary. I hope this helps.

  3. #3



    Thanks for your reply.

    I tried what you suggested but that didn't work.

    I have also been through everything in this post but still no luck

    I'm new to Plesk and I love the ease of use, but not being able to run CGI scripts is sooooo frustrating...

  4. #4
    Mega Poster
    Join Date
    Dec 2006



    PLease check the dos line endings as this is a general problem.

    You can correct this by using this command:

    dos2unix filename
    then chmod and chown back to the right user.

    If this does not work you can also check the suexec as that can be an issue too.

    For further investigations you really need to check the logs and provide some error messages.

  5. #5



    Thanks for the info.

    Looking through my error_log I have the following message:

    Premature end of script headers: setup.cgi

  6. #6


    This error is usually caused by editing the cgi file in a non ASCII mode and/or transfering the file in non-ASCII (binary) mode.

    If the script file was opened, or edited in anyway by a program that does not know to preserve the strict ASCII formatting, then the file may have been messed up. For example, Web page editors will sometimes embed HTML tags in a CGI script file, thinking it is a Web Page. Don't open a CGI script file in something like MS Word, etc.

    Perl CGI scripts should only be open with a strict ASCII text editor. and *only* be transferred in ASCII mode

    Could this be causing your problem?
    Jack D.

  7. #7



    Thanks for your reply.

    I deleted the scripts and uploaded them again in ASCII mode, but I receive the same error message.

    Plesk installs a test.cgi script within the cgi-bin for each Domain created, and this produces the same message (500 Internal Server Error).

    Does this point to the Server not being set up correctly to run cgi scripts? Unfortunately my Hosting company are not interested in looking into this issue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts