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.

Very quick phpsuexec question

Discussion in 'General Discussion' started by webignition, Feb 10, 2005.

  1. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    I'm about to take the plunge and use phpsuexec and will go about it by rebuiling Apache through WHM.

    I just have one very very quick question:

    Should I tick both "PHP suEXEC Support" and "suEXEC Module" or just "PHP suEXEC Support"?

    My current build of Apache has "suEXEC Module" ticked.

    I have half an idea in the back of my head that I read somewhere that you shouldn't use both "PHP suEXEC Support" and "suEXEC Module" and just use "PHP suEXEC Support" for phpsuexec. But then I might have fabricated that in my head somewhere.

    Could someone clarify?
     
  2. kerriritter

    kerriritter Active Member

    Joined:
    Oct 25, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    same issue, then whm problems

    i too had read or recalled something like this, and i'm sorry but poor memory escapes me but it said both the php module and the suexec modules had to be installed to do xxxxx?

    so just last night i installed the phpsuexec from apache, and had these problems which i posted in another thread. so i ended up removing it in apache, putting everything back the way it was (40+ sites between the servers). while installed it did what it was supposed to but in whm is ran into all kinds of problems accessing the sites thru whm, and still a problem on server2.

    here is my post:
    >>
    i installed, then uninstalled a php module in apache last night on two servers. server1 is ok, but from whm on server2, there are 6 domains under list accounts that when i clickon domainname.com is get this error:
    -----
    the file "" is of type application application/x-httpd-php and netscape does not know how to handle a file of this type.

    this file is located at http://domainname.com/

    what should i do with this file, open with, save to disk, etc.
    ------
    i can see the site via the ip link, just not from domainname.com link as i could before. the 16 other sites on this server are fine. just these 6 and i don't know what to look for. comparing files/dirs/etc in ones that work vs not no visible difference in putty or file manager.

    any other ideas or suggestions?

    cpanel 9.9.9 -s15 whm v.3.1.1

    thanks for any help before i just completely go insane.

    kerri
    <<

    so though i cannot advise you i wanted to let you know what i encountered and am still waiting to hear from someone how to fix. anyway, i have this thread bookmarked to see what results and replies you receive.

    kindest regards,
    kerri
     
  3. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    Kerri -

    I had this problem about a month ago. The problem was caused by buildapache updating PHP with the phpsuexec module but failing to rebuild apache. The problem was reported to cpanel who said the problem was fixed. However on subsequent tries apache did not rebuild, only PHP did. In order to have phpsuexec working, both apache and php must be recompiled. I decided to just stick with what I had, until apache is outdated, and then move to phpsuexec since cPanel wouldn't fix the problem - so i don't know whether they have or not.

    If apache didn't compile when you added phpsuexec then they haven't fixed the problem and you'll need to take phpsuexec out. There is a long thread on this issue - search for my name.

    Hope that helps.
     
  4. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    suexec allows perl and other cgi scripts to run as the correct owner (not nobody) - if you don't run cgi you don't need it. It runs just fine with phpsuexec since phpsuexec only affects php scripts. I wouldn't run a cgi enabled hosting service without it.
     
  5. kerriritter

    kerriritter Active Member

    Joined:
    Oct 25, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    apache did recompile

    hi mike,

    thanks for info and will search for your thread. apache went thru all the rebuild/recompile and eventually completed on both servers. both before i installed the phpmodule and after i removed it.

    all sites on my servers running php scripts. it is my own personal/business site i just thought i needed to run it for , for a simple cgi form mail on plain html. that was all. too tired i guess to think straight.

    thanks again and i will go take a look.

    it is just irritating for those six sites i mentioned in my original post to think the .com is an executable file, instead of a website.

    kindest regards,
    kerri
     
  6. kerriritter

    kerriritter Active Member

    Joined:
    Oct 25, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    phpexec & nobody in server processes/mail

    gosh, you all may think i'm crazy. but i remember now why i wanted phpexec mod installed it was because all mails in relayer mostly are from nobody, just a few other in a few domains.
    processes running via top noboby, that was my original issue to begin with. and sites are all php scripts. and on my old servers, both were indeed running together, i'm 99% sure.

    so what i am reading is just load the phpsuexec module and go in a disable the suexec,? the short time i had it going last night, everyones domain was named in top, etc like it should be.

    correct? i'm a little leary now after last attempt. also don't want any screamers who were using the cgi counter script or something from cpanel.

    thanks,
    kerri
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Erm, don't disable suexec - that's used by perl CGI scripts as rs-freddo said.
     
  8. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Excellent

    Thanks for all the replies everyone.

    I'll give phpsuexec a go this evening when everything is quiet and hope that all goes well.

    Just to clarify things, the only potential problems that I can think of are:

    1. Needing to change 0777'd directories and files to 0775 or less
    2. Making sure that .htaccess specified PHP config settings are put in a php.ini file in the relevant account's root.

    Is there anything else that I need to be aware of?

    I've also read somewhere that the php binary needs to be moved/copied to a different directory. Is this actually the case and if so to where would I need to move it?
     
  9. kerriritter

    kerriritter Active Member

    Joined:
    Oct 25, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    still the same

    once again, i installed the php mod and suexec had be set to enabled, and these two just don't want to co-exist on the server.

    together, they break several websites, cron jobs error, admins can't log into the admin sections of their sites.

    so once again, i have gone to apache and removed the phpmodule and all are well execpt the 6 sites that when executing/clicking their domain name whm things the are an executable .com, .exe, type application and not website.

    i have read and searched all i could on this topic, and made good sense. but i would really like to get the phpmodule installed and working so i can actually see what is going on by domain, rather than nobody. difficult/impossible to manage.

    thanks,
    kerri
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    It can be tricky enabling phpsuexec (please don't confuse it with suexec, they're really referring to different things) one a running server. It's for that reason that I always enable it on a newly provisioned server - and it is enabled on all of my servers and no-one has had any problems with it being on.
     
  11. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    I would concur with chirpy here - converting servers to use phpsuexec from mod_php can lead to a few issues for clients scripts already installed, if you aren't sure of exactly what to change and able to make changes en masse possibly with scripts for them, then I wouldn't recommend doing it.

    On a new server, clients never really know the difference, they just upload files and their scripts work without having to have files chowned and 777 permisssions everywhere.
    I think phpsuexec is a good thing, but only convert if you know what you are doing.

    Some things to note

    The php.ini files placed within a clients doc root don't propagate down through directories as standard, like .htaccess and php_values do, you'd need to place a php.ini file in each directory or make modifications if changes are required.

    HTTP authentication via php scripts won't work.

    php_value(s) won't work in .htaccess

    Files owned by 'nobody' need to be changed to the correct uid/gid
    Directory permissions need to be changed - max 755 otherwise you will get a 500 error, as you would with cgi scripts.

    Most applications won't have issues, but many will so you need to be armed with the knowledge or hire someone who does know what you need to do while implementing such a change.
     
  12. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    The server I'm going to implement phpsuexec on only has literally a handful of accounts at the moment and I've been keeping everyone updated regarding what phpsuexec is and what the results of enabling it might be and so far there has been full support.

    I don't think there will be much of a problem with chowning files to the correct people if anything is owned by nobody since the server is pretty empty at the moment. But how would I check if any files are owned by "nobody"?
     
  13. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    find /home -user nobody
     
  14. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Thanks Chirpy. Once I get the hang of everything I won't have to ask so many questions!
     
  15. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    All complete

    I've now enabled phpsuexec, chowned a few stray files to the correct users and changed any file permissions from 0777 to 0755 and all appears to be fine. I also made php.ini files for those who had php_values in .htaccess files and those affected were most happy.

    So, all went well and nothing seems to have gone wrong yet and hopefully won't do.

    What are all these problems that people seem to get with phpsuexec?

    Thanks for all the posts people have added to this thread!
     
  16. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The only ones that I've seen that aren't usually easily solvable is if the php scripts insist on using HTTP_AUTH which php through phpsuexec doesn't support. However, you can sometimes work around (of course, depending on the script) that by disabling the authentication section in the script and using a .htaccess file.
     
  17. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    "all those problems" are from when phpsuexec was first introduced by cpanel - they've got it pretty foolproof now but people won't forget...
     
Loading...

Share This Page