FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » What are correct file permissions for 3.04? (I have everything on 666/777, can't be right?)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Lockups with 500 error is caused by permissions [message #168845 is a reply to message #167634] Sun, 28 July 2013 21:37 Go to previous messageGo to previous message
Parrot
Messages: 32
Registered: July 2013
Location: US
Karma:
Member
Summary:

Failures during installation and during operation with a "500 internal server error" are in some or all cases due to permissions.

After detailing what happens and what causes it, a possible solution is suggested for naudefj/Frank's decision.


Problem:

Installation kept failing with blank screens and, in the page source, a 500 error. Tried installing FUDforum 3041, 304, and finally 305RC1. Eventually tried changing all permissions from 777 to 775. Then it installed and worked. (Initial impression of FUDforum: very nice)

Soon after installation, the same error occurred. Blank screens from user interface and admin interface, again with the 500 error. Found the directories set at 777, apparently during installation. Changed them to 775. Then FUDforum started to work normally again.

Explored FUDforum for a couple of hours and changed some settings. Shortly after, the forum stopped working again. Sure enough, the directories I had set to 775 were changed by the software to 777. (BTW, I've been evaluating several forum products, most recently MyBB (pretty good), and none had this permission problem.) Asked host's tech support for help.


Cause:

My host refuses any file with 777 permission. Here are some explanatory quotes from their messages:

Quote:
The 500 error was being generated due to incorrect permissions on your account. I have corrected the permissions

I have reviewed your account once more, and I found that your forum directory was set 0777 permissions. I also found 0777 permissions within the forum directory.

Please note that the security environment on HostGator servers disallows you from using 777 permissions and will return a 500 error if you have any files or folders set in such a manner on your account.

The likely reason that the script developers recommend 777 permissions is because the default environment they developed this software in may not have suPHP. In a default server environment, scripts that use PHP will run as a user called "nobody," which means that the the files that the script uses need to be set to 777 to even run. suPHP allows for scripts to run as a cPanel user instead of "nobody," which means that you can secure the script with 755 and 644 permissions instead. It also prevents you from being able to set different permissions that are higher than that. The 500 error simply prompts you to the fact that there is an error, and in our circumstance cannot be made more detailed.


I don't know about suPHP, etc., but presumably you will understand this.

In any case, they are unlikely to change their servers' security settings to accommodate FUDforum software.


Possible Solution:

FUDforum permissions seem to be set by the file [forum data path]/include/compiler.inc in several lines:

Line 740:

$perms = $GLOBALS['FUD_OPT_2'] & 8388608 ? 0700 : 0777;
if (strncmp(PHP_SAPI, 'apache', 6) && $perms == 0700) {
$perms = 0711;



Line 812:

if (!@is_dir($path) && !@mkdir($path, 0777)) {
throw new Exception('ERROR: Unable to create directory: '. $path .'.<br />');



Line 856:

if (!@is_dir($path) && !@mkdir($path, 0777)) {
throw new Exception('ERROR: Unable to create directory: '. $path .'.<br />');


Line 895:

if (!@is_dir($path) && !@mkdir($path, 0777)) {
throw new Exception('ERROR: Unable to create directory: '. $path .'.<br />');


Are permissions set by other FUDforum files?

An obvious solution to try is editing compiler.inc and changing all 777 to 775.

But FUDforum is not simple software. Its internal relations are complex and highly interactive.

That's why I'm asking you. What can I do to stop FUDforum from setting 777 permissions?

Thanks.




[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem importing data before upgrading the forum (2.7.6->)
Next Topic: Maillist.php works from command line but not postfix pipe
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 27 14:56:59 GMT 2024

Total time taken to generate the page: 0.04427 seconds