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.

Problems Unsure if it is a bug or not but Error 500 with my php script

Discussion in 'General Discussion' started by barkermn01, Feb 3, 2011.

  1. barkermn01

    barkermn01 Member

    Joined:
    Mar 17, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hello all,

    Let me start by saying as the title does im not sure if this is a bug or not thats why i have asked in the Discussions part of these forums,

    Right my problem is i have writen a MVC system "Lightweight MVC" now this system has rapidly become the biggest lightweight MVC there is kicking LiteVC out of first place on google(UK) (not bad to say it does not have a site of its own)

    But i have had 2 people tell me that they have failed to use it it they just get given "Error 500",
    Now i have a cpanel box my self so i uploaded this script to it and it gave me "Error 500" so i looked into this a little more with nothing in the Apache Error logs i started to play on the bases it was a Permissions error.

    So i check the file Owner ship and ran

    Code:
    cd /home
    chown -R cerisc:cerisc cerisc 
    Now all files in that domains folder were setup correctly but still error 500,

    So now i check the permsions (something i would never do on a live environment)

    Code:
    chmod -R 777 cerisc
    Still error 500 now this is what confused me an error 500 is a script or permissions error but with nothing in the error log and nothing being displayed even though the first 2 lines of my code were turning error reporting on E_ALL and display_errors = 1 i should not have been seeing an Error 500

    So i look again at it and think so this time i recompile apache and php (easyapache) and disable suExec and bang i'm working

    So what im not sure about is why suExec is not working on files in the user folder but not in the public_html folder.

    Could some one verify this then and possibly tell me a fix without disabling suExec as there are more and more MVC's using files outside of the hosted directory(public_html) so is this a bug or a permissions error any help would be usefull for my users

    /http://www.phpclasses.org/package/6363-PHP-Implements-the-MVC-design-pattern.html
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    This is never gonna be bug with cPanel. There should be something in the error log which will help us to track the issue. Please tail the apache error log using the below given commend and let us know the results.

    tail -f /usr/local/apache/logs/error_log
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Of note, running mass chown and chmod commands such as were done will break several things working on the user's account. The mail password folder /home/username/etc must have username:mail ownership. Some other folders need to have 750 or 755 file permissions. Under suPHP (rather than DSO), public_html folders cannot have 777 but must be no higher than 755, while files cannot be higher than 644. It is possible to break an entire site by recursively chowning and chmodding such as was done in this instance.
     
  4. barkermn01

    barkermn01 Member

    Joined:
    Mar 17, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    There is only hosting on this account no mail or any thing and in reply to Varada S you evidently dint read its not a script error as DSO works. and i cleared the log loaded the site then opened the log the only error i got was the trying to access the favicon file, due to the site not having one,

    This MVC is built to work the same as Zend Framework with a couple of modifications to lower load and make it easier for the programmer from my personal experience,

    public_html/index.php -- require ../bootstap.php
    bootstap.php-- frist 2 lines are errors on E_ALL and display errors on.

    "while files cannot be higher than 644. " -- this can not be correct you have prevented Execution of scripts that would break Zend Framework, CakePHP and any thing else with files outside out the public_html


    On another note on my VM on my Development system i setup FastCGI suExec and my script worked perfectly on it and windows Xampp (so caps and none caps sensitive before some one says that)

    And just as a note please dont treat me like a idiot i have been building Linux Apache servers for 5 years now without the aid of cpanel the only reason i have it is for ease of my clients that pay for access to it.
     
    #4 barkermn01, Feb 4, 2011
    Last edited: Feb 4, 2011
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Actually, Varada S referred you to the wrong error log. The correct log to check is the SuPHP log (for PHP apps running under SuPHP) or the SuExec log (for CGI apps). We enable SuPHP and SuExec by default so no user can compromise the content of another account.

    The SuPHP log is: /usr/local/apache/logs/suphp_log

    The SuExec log is: /usr/local/apache/logs/suexec_log

    For the locations of other logs in a cPanel&WHM environment, you can visit Order FREE 24x36 Log Locations Poster - cPanel Inc. and request a free poster be mailed to you or click on the image and zoom in.

    As you point out, the beginning of that sentence is important: "public_html folders cannot have 777 but must be no higher than 755, while files cannot be higher than 644."
     
Loading...

Share This Page