The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unusual phpsuexec Problem

Discussion in 'General Discussion' started by x86eon, Jun 27, 2006.

  1. x86eon

    x86eon Member

    Joined:
    Jun 3, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    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.
     
  3. x86eon

    x86eon Member

    Joined:
    Jun 3, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  4. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  5. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    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.
     
  6. x86eon

    x86eon Member

    Joined:
    Jun 3, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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:
     
  7. Solokron

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle
    cPanel Access Level:
    DataCenter Provider
    Did you ever resolve this?

     
  8. x86eon

    x86eon Member

    Joined:
    Jun 3, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  9. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  10. Solokron

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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.

     
  11. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Try the solution I gave you in one of your threads.
     

Share This Page