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.

Can I turn off suPHP for just one domain?

Discussion in 'Database Discussions' started by betoranaldi, Jan 9, 2008.

  1. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Is it possible?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This is not possible at this time. Any kludge to make this possible for one domain (typically a concurrent PHP setup, one version with SuPHP, the other without) would likely allow your other users to turn off suPHP as well.

    May I ask why you would do this for a particular domain? Virtually all PHP scripts will work within a suPHP environment, though some may require tweaking to prevent them from settings things to be globally writable.
     
  3. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    After transfering all my domains to my new cpanel installed server, all but one domain is working properly. The domain has a content management system installed which works perfectly. It also has a script installed that allows it to interface with google calendar, which is causing 500 errors. Once I disable this script, the site works fine.

    I was hoping to disable suphp on this one domain (although i really don't want to) until I could come up with a fix, but it doesn't look like that is possible.

    I don't know enough about the script to modify it myself. Is there any type of resource that would at least point me in the right direction as to why the script wont work?

    I did some more troubleshooting at it appears to be the SimplePie integration it has.
     
    #3 betoranaldi, Jan 9, 2008
    Last edited: Jan 9, 2008
  4. RickG

    RickG Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    238
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    North Carolina
    More than likely this is a simple permissions error. Have you looked in the error logs for more detail as to what is causing the 500 error?

    SimplePie caches database results and the cache directory needs to be server-writable. If this is causing the error you may want to check permissions of this directory as it may have been different if suPHP was not used under the prior account.
     
  5. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16

    I'm afraid permissions are correct, I am going to try to update to the latest version of simplepie and see if it corrects the problem.


    When I run the simplepie test packaged with the script I am trying to run, I get a 500 but I just downloaded the latest simplepie package from their website and ran the test script included in that package and it runs correctly.

    Thank you both for your help, I will let you know how I make out.
     
    #5 betoranaldi, Jan 9, 2008
    Last edited: Jan 9, 2008
  6. 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
    What does the apache error log show when you get this 500 error?

    The apache error log should be located at /usr/local/apache/logs/error_log
     
  7. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    ...premature end of header...
     
  8. 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
    on what file? (You don't have to post the path and file).

    What are the permissions on that file?

    Make sure the permissions are set to 644:

    chmod 644 /path/to/file
     
  9. 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
    Also make sure you don't have any folders that are set to 777 on your account.

    With the PHP file that is reporting premature end of headers make sure that the parent folder is not set to 777 or, rather that is set to 755.

    You can reset the permissions for all of your folders with:

    find /home/username/public_html -mindepth 1 -type d -not -perm 0755 -not -name _vti\* -exec chmod 755 {} \;

    This will find all folders under /home/username/public_html that are not set to 755 and will change them to 755. I exclude any folders that begin with _vti* because I think they have something to do with Frontpage extensions, and I'm not sure if it is wise to play with those permissions.
     
  10. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I ran the above command, it didn't change anything.

    After a few hours of troubleshooting I have determined it is indeed SimplePie. I tried to just SimplePie alone...

    So I run the SimplePie system test and it indicates that it can run on my system.

    It doesn't matter what feed I try to use. I get an internal server error every time.

    I loaded the demo on my site and I can load the demo page provided but once i try to read a url I get an internal server error. All permissions are correct.

    http://burningtwig.com/SimplePie1.1/demo/

    Looking at apache error logs I get

    Premature end of script headers: index.php, referrer: http://burningtwig.com/SimplePie1.1/demo/

    So that is were i stand thus far...
     
  11. 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
    Can't say as if I have ever seen an issue like this before.

    Try running this command from the shell:

    Code:
    /usr/bin/php /home/user/public_html/SimplePie1.1/demo/index.php feed=http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml
    Does that give any clues?
     
  12. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    it spit out...

    Segmentation fault (core dumped)
     
  13. 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
    There's the problem, though I don't have any idea on how to really go about resolving it.

    Are you running PHP4 or PHP5?

    /usr/bin/php -v

    I do seem to recall one instance where I had a user that was experiencing a segmentation fault, this was back when I was running PHP4 by default on all of our servers. I switched that account over to PHP5 and that resolved this issue. That doesn't really offer a solution as to what the specific problem was, but it did seem to fix it.

    If you are running PHP4, you might consider upgrading to PHP5 and see if that resolves this issue for you.
     
  14. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I am running the latest version of php 5 and apache 2 so I cant upgrade :(

    Thank you for you help in trying to narrow down the problem.
     
  15. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I think i narrowed it down to curl.

    If i create a script

    Code:
    <?php
    
    var_dump(curl_version());
    
    ?>
    and run it from shell...

    Code:
    # /usr/bin/php /home/user/public_html/SimplePie1.1/curl.php
    Segmentation fault (core dumped)
    
    So now to figure out why curl is crapping out.
     
  16. 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
    That would be one way to handle this. Do you really need curl in your PHP installation? If not, just recompile PHP without curl.

    Maybe even just recompiling PHP (with curl and the same options that are currently installed) might fix the problem.

    Segfaults are usually where I draw the line. If I run into a segfault, I just know that there's something wrong, I'm not too good at fixing those problems. What you've done sounds like a good start.
     
  17. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I recompiled php down to 5.2.4 to see if that solved the problem, but it still occurred.

    Curl is need for one custom application i have created that reads a url and then send that url as a body of an email. Is there another way to read the content of a webpage? If so I can compile php without curl and see if that helps while not breaking this other application.

    Thanks again for all of your help, its really appreciated.

    -brian
     
  18. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    sparek-3... Thank you! Thank you! Thank you! Thank you!

    I recompiled php without curl and SimplePie is working properly. I will just modify my other application to work again.

    Thank you so much for your help, I would not have been able to figure this out without you.

    Thanks
    Brian
     
Loading...

Share This Page