The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CGI Path Not Found When Using SUEXEC

Discussion in 'General Discussion' started by vince512, Mar 15, 2008.

  1. vince512

    vince512 Active Member

    Joined:
    Nov 16, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hello,
    I have spent the last 2 days trying to figure this out but can't, so I was wondering if someone can point me in the right direction. I have installed CentOS 5 with cPanel on my machine last week and I have transferred all of my accounts to the server. I am running Apache 2.2 with PHP 5 in SUPHP an SUEXEC. It seems that when running SUSEXEC the cgi files on users accounts do not work...it can't seem to find the correct cgi path. Is there something I missed? Is there a change in the CGI path when running SUEXEC now?

    Here is what I see in the error log(I deleted the IP):
    [Sat Mar 15 17:20:10 2008] [error] [client xx.xxx.xxx.xxx] /bin/pwd: cannot open directory `../../../..': Permission denied

    Also when running a test script it says:
    FAILURE!
    The complete file path to this script could not be determined.

    It worked on servers before in our other servers in suexec and phpsuexec, but they have not been upgraded to apache 2.2 yet nor were the centos 5

    I appreciate any input.
     
  2. vince512

    vince512 Active Member

    Joined:
    Nov 16, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Asctually ater further testing, I turned off suphp and suexec and ran the test script and it still could not determine the cgi path. So it must be something with centos5 and cpanel. The usual cgi path does not seem to work when coded into scripts that need the path defined:

    /home/user/public_html/cgi-bin


    If anyone else ran into this issue using cPanel with Centos 5, I would like some input on how to fix this issue.
     
  3. kemis

    kemis Well-Known Member

    Joined:
    Feb 17, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Georgetown, TX
    I just upgraded my server from Apache 1.x to 2.2 and PHP4 to PHP4 + PHP5. I now have the problem you're describing. I, also turned of SuExec & stil have the problem.

    I think it has something to do with Apache 2, but I really have no idea. I know just enough to solve basic problems & really rely on cPanel to handle the majority of the technical stuff.

    Can anyone please let me know what to update/change to get my CGI apps working again?

    Thanks!
    Matt
     
  4. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    hate to dig up old thread also but now that I upgraded also to apache 2.2.11 I am having the same issue. The cgi scripts give me a 500 Internal Server Error

    I can place the script in the cgi-bin folder and get it to work.
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Did you compile Apache with "discard CGI path" enabled?

    If so .... OOPs! :D

    With that enabled, you can only call CGI scripts by relative reference
    and cannot use absolute server paths plus that setting tends to do
    screwy things with PHP running in CGI mode

    Side note on running PHP in CGI or SuPHP mode now that you mentioned error 500 ...

    You cannot have the permissions on your scripts set to 777 or 666 or placed in any
    directory with those same permissions or the script will fail to run and generate
    an error condition for you site.

    Similar, if you have any "php_flag" or "php_value" commands in a .htaccess file
    with plain CGI or SuPHP based PHP then you'll also generate an error 500 condition
     
    #5 Spiral, Jul 12, 2009
    Last edited: Jul 12, 2009
Loading...

Share This Page