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
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).