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.

php.ini being reset daily

Discussion in 'General Discussion' started by djbob2, Jul 30, 2008.

  1. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    My php.ini is being reset daily. I have absolutely no clue what's going on, but it's got to be cPanel/WHM - the clear is done during the upcp process and the only thing non-cPanel I have installed on my server is Django (other than some extra utilities I installed, like vim).

    This is a major problem, as my customizations for loading Ioncube and PDO are being erased nightly (note that these customizations were added by cPanel/WHM itself through Easyapache). My users are not happy with this and I have had to resort to customizing the php.ini early every morning.

    I have submitted the same post as a support ticket, but I thought perhaps the forum community might know what's up.

    Thanks,
    djbob
     
    #1 djbob2, Jul 30, 2008
    Last edited: Aug 1, 2008
  2. MaraBlue

    MaraBlue Well-Known Member

    Joined:
    May 3, 2005
    Messages:
    335
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Carmichael, CA
    cPanel Access Level:
    Root Administrator
    Same here. It just seemed to have started (for me, anyway), on August 1st. From what I've read, it's a change in how PHP5.2.6 loads extensions, and they changed the way runtime loaders get called. Haven't found a solution yet (all the ones I've tried aren't working), but if I do, I'll post here.
     
    #2 MaraBlue, Aug 2, 2008
    Last edited: Aug 3, 2008
  3. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    The problem seems to be Ioncube loaders for me, but I'm not sure this is new to PHP 5.2.6. Downgrading to PHP 5.2.5 does not fix this problem, and it started occuring a few months after the release of PHP 5.2.6.

    I have been talking with cPanel support, and once we figure out a solution I will post it here :)
     
  4. MaraBlue

    MaraBlue Well-Known Member

    Joined:
    May 3, 2005
    Messages:
    335
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Carmichael, CA
    cPanel Access Level:
    Root Administrator
    Both PHP 5.2.5/5.2.6 changed the way runtime loading works (it was presumably a security enhancement), if you use runtime. Also, check the under the [Zend] section (at the very end) of your php.ini. Ioncube has to be *first*, like so:

    Code:
    [Zend]
    zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.2.so
    
    More reading on this, should you be so inclined:
    http://forums.crm.saeven.net/showthread.php?t=993
    http://tickets.jomres.net/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=98

    http://www.directadmin.com/forum/showpost.php?p=117799&postcount=6
     
  5. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Hello all,

    Russell from the cPanel Support team finally figured out what was causing the issue. There was an infinite loop of php.ini includes.

    The include_path of /usr/local/lib/php.ini included /usr/local/cpanel/3rdparty/lib/php/, and the php.ini in /usr/local/cpanel/3rdparty/etc/ was linked the original php.ini. Russell removed the link and put a real file in there. In short, if this problem is happening to you make sure you check your include_path directive and check for any php.ini files around there :)
     
  6. djbob2

    djbob2 Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    One last update. I'll explain the problem here - turns out that there were two php.ini files, and the problem we fixed was just a symptom of the first.

    The problem: cPanel's /scripts/upcp replaces cPanel's internal php.ini file automatically every time it is run. Unless cPanel knows what configuration you are running, it will replace your php.ini nightly.

    Fantastico, a popular scripts installer that uses internal cPanel PHP, requires the Ioncube loaders extension in php.ini. When you install Ioncube loaders to cPanel's internal php.ini they are discarded nightly. The recommended way of preventing this, a script called save_php_inis, just spits out bugs when called.

    For my situation, I had an extra problem. Since my internal php.ini was simply a link to my main server php.ini, when the internal file got replaced nightly it was replacing the main server php.ini, which caused further problems by removing a bunch more extensions I had configured.

    External php.ini: /usr/local/lib/php.ini
    Internal php.ini: /usr/local/cpanel/3rdparty/etc/php.ini

    The fix: Just run /scripts/makecpphp after configuring Ioncube loaders through Easyapache. Make sure you get rid of the link if you have one. Took me a while to figure this out.

    I'd post this fix to the support topic I opened to let the cPanel techs know how to fix the issue, but the topic has already been closed and I don't want to bother them with a new one :)
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    For IonCube extensions in the internal php.ini, you merely need to check the box in Tweak Settings for the extension to be retained across a upcp.
     
Loading...

Share This Page