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.

Problem with install Suhosin

Discussion in 'General Discussion' started by alexandz, Feb 21, 2012.

  1. alexandz

    alexandz Well-Known Member

    Joined:
    Oct 28, 2011
    Messages:
    111
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Chile
    cPanel Access Level:
    Root Administrator
    Hi, yesterday compile suhosin EasyApache to install php and went well, but then check the logs and I found the following:

    PHP Startup: Suhosin Extension does not officially support PHP 5.2 and below anymore, because it is discontinued. Use it at your own risk.

    How I can fix it?
     
  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
    The feature request forum is not a forum to post anything other than feature requests. I figured I would mention this since you have done this twice. I am moving your request to one of our technical support forums so you can receive appropriate assistance.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello alexandz,

    The choices would be to either upgrade to PHP 5.3 rather than using PHP 5.2 or to manually install a SuHosin version that supports PHP 5.2 using something like the following:

    Code:
    cd ~
    wget http://download.suhosin.org/suhosin-0.9.31.tgz 
    tar zxf suhosin-0.9.31.tgz
    cd suhosin-0.9.31
    phpize
    ./configure
    make
    make install
     
  4. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Tristan, I have a few questions if you don't mind... if I follow the above method:

    - I first run EasyApache and un-check the Suhosin option and recompile, correct?

    - Will de-selecting suhosin on EasyApache and recompiling un-install 0.9.33 ?

    - If I go to the manual installation of 0.9.31 will it complicate / inhibit my ability to eventually go back to using EasyApache for suhosin (eg: if I can ever get rid of older script users and finally upgrade to php 5.3.x) ?

    If you (or anyone) wouldn't mind posting a few details / discussion about this I'd greatly appreciate it. I'm in a bit of jam since I have multiple servers running php 5.2.17 and I can't go any higher because 5.3.x breaks some user scripts.

    Thanks for any thoughts, opinions, and advice from anyone!
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Rather than running EasyApache, simply uninstall SuHosin using the PHP extension manager, which does the same task:

    Code:
    /usr/local/cpanel/scripts/phpextensionmgr uninstall PHPSuHosin
    If you uninstall it, you'll have the /usr/local/lib/php.ini file remove the suhosin.so extension and it will also be removed from /usr/local/lib/php/extensions/no-debug-non-zts-20060613 location. If you install it manually after that, it would put a new suhosin.so file into /usr/local/lib/php/extensions/no-debug-non-zts-20060613 spot. You will need to add the extension="suhosin.so" line at the end of /usr/local/lib/php.ini file, though.

    If you manually install it, it doesn't inhibit any ability to go back to using the version in EasyApache. You would need to always keep a backup copy of suhosin.so file from /usr/local/lib/php/extensions/no-debug-non-zts-20060613 in /root or somewhere, because any time you update EasyApache, it will wipe that file due to the manual compilation of SuHosin on the machine. You'll also need to re-add the suhosin.so line each time you update using EasyApache.

    You could always create a /usr/local/cpanel/scripts/posteasyapache script hook to readd the extension line and recopy the suhosin.so file into that directory from a backup. Here's an example of what you could use (and, yes, this would need to be removed if you ever do update to PHP 5.3 and want to use our SuHosin copy):

    First, copy suhosin.so

    Code:
    cp /usr/local/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so /root/suhosin.so
    Then create /usr/local/cpanel/scripts/posteasyapache file with these contents:

    Code:
    #!/bin/bash
    
    cp /root/suhosin.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
    grep -q 'extension="suhosin.so"' /usr/local/lib/php.ini || echo 'extension="suhosin.so"' >> /usr/local/lib/php.ini
    /etc/init.d/httpd restart
    Now, give the file execution permission:

    Code:
    chmod +x /usr/local/cpanel/scripts/posteasyapache
    Going forward, when you run EasyApache, ensure SuHosin is unchecked during the EasyApache build and the copy of the suhosin.so you'd previously built manually will be copied to the /usr/local/lib/php/extensions/no-debug-non-zts-20060613 directory. You'll also add the extension to /usr/local/lib/php.ini file only if it doesn't already exist in the file (that's the purpose of the grep).
     
  6. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    My server have 2 folders:
    extensions/no-debug-non-zts-20060613/
    extensions/no-debug-non-zts-20090626/

    I solved this doing this on the 2 folders:

    mv suhosin.so suhosin.bak

    Get the suhosin.so from my other server with php 5.2.17 and put this inside this 2 directories.

    Here the file suhosin.so from my server with 5.2.17 -removed- if someone need it.

    This file is in the zip format, for me, the best way to put this file inside the server, is using winscp. (windows here)

    Sorry about bad english =)
     
    #6 fcbinfo, Mar 1, 2012
    Last edited by a moderator: Mar 1, 2012
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The no-debug-non-zts-20090626 folder is used by PHP 5.3 to my knowledge. You have no need to use it for PHP 5.2 and why the instructions are for the no-debug-non-zts-20060613 folder instead.
     
  8. golden_eyes

    golden_eyes Well-Known Member

    Joined:
    Aug 9, 2010
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    I ran the above commands in order to install the suhosin but there is noting changed? how I can know that the suhosin is enabled? My php version is 5.2.17 and the Suhosin is not exists in the EasyApache

    Please note that the extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ already added to the php.ini
     
    #8 golden_eyes, Oct 18, 2012
    Last edited: Oct 18, 2012
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    There were more commands besides those entered in your reply. Did you copy the suhosin.so to the right folder and all?
     
  10. arabgenius

    arabgenius Member

    Joined:
    Jun 25, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    thank you
    I just renamed the existed suhosin.so
    then I install old version manually
    ---------------
    cd ~
    wget http://download.suhosin.org/suhosin-0.9.31.tgz
    tar zxf suhosin-0.9.31.tgz
    cd suhosin-0.9.31
    phpize
    ./configure
    make
    make install
    ---------------------
    then I added the line to php.ini
    extension="suhosin.so"

    and it works fine
     
Loading...

Share This Page