Results 1 to 6 of 6
  1. #1

    505 Internal Server Error

    I get this error when setting permissions to a file to 777

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. --

    Could someone please tell me how to fix this so it will work with the permissions set to 777?

    In SSH the error log shows this,

    [Sun Sep 17 22:59:14 2006] [error] [client XX.68.239.XX] Premature end of script headers: /home2/XX/public_html/control/index.php
    [Sun Sep 17 22:59:14 2006] [error] [client XX.68.239.XX] File does not exist: /home2/XX/public_html/500.shtml


  2. #2
    Join Date
    Jul 2005
    Your host runs PHPSUEXEC, meaning that if you CHMOD files to 755 or more, then you will get a "500 - Internal Server Error".

    You can CHMOD folders to 777, but not files. However, 755 is basically 777 PHPSUEXEC, because Apache operates under your user, not 'nobody'.


  3. #3
    It happened when I CHMOD a folder. Not a file.

  4. #4
    Anyway.. how do I fix this?? I own the server.

  5. #5
    Join Date
    Nov 2005
    Quote Originally Posted by PSPLEG
    It happened when I CHMOD a folder. Not a file.
    That's an even more dangerous situation (any security hole can allow anyone to upload a legitimate-looking rogue php script into your website), so phpsuexec will restrict it as well. When running php scripts on a server with phpsuexec (just like cgi scripts on a server with regular suexec), you are not allowed to run any scripts that are located in directories with permissions that are higher than 755, and you are not allowed to run php scripts with permissions set higher than 644 or 755. Files with permissions set higher than that can be written to by multiple users, either other users in that group or any user with access to the box (e.g., through a security hole in another script on your server). Regardless of whether or not multiple users exist on that server, the security restrictions will not allow it, because it allows someone (anyone) to insert their own insecure (possibly dangerous) code in what is supposed to be a secured file.

    Your best bet would be to only store directories that need to be chmod'ed 777 somewhere outside of your webroot, or at least in some directory other than where the script is located. If your script absolutely requires that it is run from a 777 directory, then either see if you can get phpsuexec removed from that domain/account (don't know if your cPanel box can do this on a per-account basis), or just look for a better script (this may be the better option since a script that *absolutely* has to be run from a 777 directory is probably a poorly-coded script).

  6. #6
    What are you talking about?? The script for my domain says to make certain directories 777!

    I've done this in the past without a problem as many scripts ask you to set these permissions!

Posting Permissions

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