internal server error

Status
Not open for further replies.

maku777

New Member
Messages
12
Reaction score
0
Points
0
was something changed today? :dunno: I'm getting the internal server error as well on some of my .php scripts.

can we not chmod 777? my site was working ;) until today and some of the files have to have write permission.

maku.x10hosting.com

the specific problem in in the folder /statfink/helm/league.php needs 777, but if i change it, it reverts back to 755 and give me internal server error.

thanks.
-maku
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
PHP files can't be 777, they have to be 755 or less.

-Corey
 

maku777

New Member
Messages
12
Reaction score
0
Points
0
do you have any ideas I can check into as to why i'm getting this error now? everything worked perfectly until this afternoon...maybe something got tweaked or needs to be tweaked.. :)

Thanks,
-maku
Edit:
the error log in the cpanel says "error: file is writable by others" and "error: directory is writable by others"

again, this just started today...do you know why?

thanks,
-maku
 
Last edited:

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Yes, it is because we installed PHPSuexec... the permissions have to be less than 777 like I stated above. Change the permissions and the error will go away.

-Corey
 

maku777

New Member
Messages
12
Reaction score
0
Points
0
Ok...I changed all the permissions to 755 for PHPSuexec.

Question: Will the server run files like they were 777 with PHPSuexec installed and the files set at 755?

I'm getting these errors now...I don't know if it is a permission issue or not.

Warning: strpos() [function.strpos]: Offset not contained in string. in /home/maku/public_html/statfink/helm/league.php on line 208

Warning: strpos() [function.strpos]: Offset not contained in string. in /home/maku/public_html/statfink/helm/league.php on line 214


Other than that, most of the rest of the script appear to run.

THanks Corey,
-Maku
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Only some things can be set to 777, nothing with an executable PHP File though. I'm not sure why you're getting that error now, I would seek some support from the script creator or check google for that error.

-Corey
 

maku777

New Member
Messages
12
Reaction score
0
Points
0
Corey,

I gave the error to the script creator, I'm awaiting his response, but he asked me to ask support at x10 this:

"Can you change ownership of directories? If you can do that, it should work. Find out what username the web server runs as on the server, and then change ownership of the directory to that user. In linux/unix, this is done with the "chown" command. Alternatively, you can ask the support people that you want a directory that is "web writable" and they should know what that means. It means a folder that the web server is able to write to. On normal hosts, I intentionally have the web server create the directory for your league, therefore it owns the directory, and the directory doesn't need to be 777. They should be able to work with you on this, it isn't that hard. There may be an option from your cpanel to do it, or maybe if you just create the directory in your cpanel it may be owned by the web server. "

Will this be possible?

Thanks,
-Maku
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
I will go ahead and change the ownerships of all files in your account to you, maybe that will fix it.
 

maku777

New Member
Messages
12
Reaction score
0
Points
0
Corey...let me apologize for the length of this first. I got a detailed response as to the problem with the fantasy football script and making it work with the newly applied PHPSuexec on the server. Here's what they think in the script forum:

"Ok guys, apparently I wasn't clear. To understand this you have to understand unix permissions. "777" means read/write/execute to everyone. The first number refers to the owner of the file. The second number refers to the group that owns the file, and the 3rd number refers to "others". 7 means read/write/execute, 5 means read/execute, 4 means read only. Let's say your user is named "maku" and you belong to a user group named "webusers". Any files that maku makes on the system are owned by maku, and the group associated with that file would be webusers. In this scenario, a permission of 755 would give read/write/execute to the OWNER of the file only, and read/execute to the group and to "others". Since this is the maximum permissions you're allowed to use on x10hosting now, this is where the problem lies. The program that php scripts run under, usually "apache", is not run by the user "maku". Apache is unable to write to maku's folders since it doesn't have permissions to do so. Statfink requires that apache is able to write files into your statfink directory to update the scores and write configuration files.

The only way around this, is to allow apache to "own" the folders that statfink needs to write to. This way, a permission of 755 would work fine. Remember, the first digit of a permission is referring to the permission the owner of a file has on that file. If you make apache the owner of the folder that it needs to write to, then 755 works great. Remember, the concepts presented here are real, but the usernames I talk about are hypothetical. It is common that the username that the web server software runs under is named "apache", but it is not always the case. In any case, it is probably too much of a pain to do this on x10hosting, since I don't think you can change the owner of a file through ftp. Any file you upload or create through ftp will be owned by YOUR user. I know this is somewhat confusing, but to understand what all this 777/755 nonsense means, you have to understand unix file permissions. Setting the ownership of all the files in the directory to your user, as the x10 support guy seems to have done, will work against you. You'd be better to have him change the owner of all the files in your directory to whatever the web server's user name is. This would make it all work."

So it looks like it can/will/should work with 755, but we need to give ownership to the apache server. Can we do this on our own through the cpanel or any other way? Is this something you can do?


Sorry again for the length, but perhaps we're getting close to a solution.

Thanks again,
-Maku
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Please PM me a link or login where I can see the error first hand so I can troubleshoot it.

-Corey
 
Status
Not open for further replies.
Top