x86eon

Member
Jun 3, 2006
6
0
151
On certain scripts I get a internal server error when phpsuexec is installed (they all work fine without it). When I check the error log for these scripts all I see is "Premature end of script headers". I have checked suexec_log as well and there is nothing unusual. The one script (Filebrowsers thumbnailer) only causes an internal server error when thumbnailing large images (over 2 MB) and with the other script (Drupals module page under administer) I only get this error when I upload more than 1 extra module. These are the only scripts I have found any problems with so far. I have tried replacing/reinstalling them several times and they all have the correct permissions. What else should I check and how do I fix this? I am completely baffled.
 

webignition

Well-Known Member
Jan 22, 2005
1,880
0
166
x86eon said:
The one script (Filebrowsers thumbnailer) only causes an internal server error when thumbnailing large images (over 2 MB)
As for this, it might be due to memory issues. Admittedly if a PHP script runs out of memory, it will generally give an 'out of memory' error, but you never know.

Opening images, particularly compress formats such as jpegs, takes a fair amount of RAM - a jpeg with a 2MB filesize could easily require up to 16MB of RAM.

You might want to check the error_log file created in the directory from which the script runs to see if any further details are mentioned.
 

x86eon

Member
Jun 3, 2006
6
0
151
I increased the memory limit in php.ini from 8M to 32M and I am still getting an internal server error with Filebrowser. For some reason these errors are not causing an error_log to be generated in same directory as the script.
 

oulzac

Well-Known Member
Aug 7, 2005
131
0
166
login to ssh and run

chown username:username /home/username/public_html/* -R
chmod 755 /home/username/public_html/* -R

then try again. remember to replace username with the accounts actual username
 

sparek-3

Well-Known Member
Aug 10, 2002
1,929
178
343
cPanel Access Level
Root Administrator
oulzac said:
chown username:username /home/username/public_html/* -R
chmod 755 /home/username/public_html/* -R
The first one makes sense, but I'm not sure if you want to set the permission on everything under the public_html to 755. The directories maybe, but not the files. I'm not sure if PHP scripts will execute with phpsuexec if they are above 644. You might try:

chown -R username:username /home/username/public_html
find /home/username/public_html -type d -exec chmod 755 {} \;


This will change the ownership of all files and directories under the public_html directory to the account's username. The next command will find all directories under the public_html directory and set the permissions on those directories to 755, which should be correct for phpsuexec.
 

x86eon

Member
Jun 3, 2006
6
0
151
I ran those commands but the problems are still there. All the scripts run okay except when I try to do the things mentioned above, so I don't think it's an ownership problem. Any other ideas? :confused:
 

Solokron

Well-Known Member
Aug 8, 2003
850
1
168
Seattle
cPanel Access Level
DataCenter Provider
Did you ever resolve this?

x86eon said:
I ran those commands but the problems are still there. All the scripts run okay except when I try to do the things mentioned above, so I don't think it's an ownership problem. Any other ideas? :confused:
 

x86eon

Member
Jun 3, 2006
6
0
151
Nope. I have asked others as well and they too have found the problem mystifying. cPanel support is blamed it on the scripts themselves but I know this not to be the case as it affects every script used. The scripts we are using also worked fine under a similar cPanel enviroment with phpsuexec.
 

oulzac

Well-Known Member
Aug 7, 2005
131
0
166
this issue is just with the public_html folders

do this:
chown username:username /home/username/public_html
chmod 755 /home/username/public_html

*do not do it recursive, just the public_html folders
 

Solokron

Well-Known Member
Aug 8, 2003
850
1
168
Seattle
cPanel Access Level
DataCenter Provider
This does not apply. Clients have been in a php suexec environment with 4.4.2 previously and worked fine.

oulzac said:
this issue is just with the public_html folders

do this:
chown username:username /home/username/public_html
chmod 755 /home/username/public_html

*do not do it recursive, just the public_html folders
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,221
4
193
Minneapolis, MN
Solokron said:
This does not apply. Clients have been in a php suexec environment with 4.4.2 previously and worked fine.
Try the solution I gave you in one of your threads.