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 configuration "sticks"

Discussion in 'General Discussion' started by Mads Nordholm, Jun 23, 2015.

  1. Mads Nordholm

    Mads Nordholm Member

    Joined:
    Jun 7, 2015
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    I'm having some real trouble updating my php.ini file. I need to change the memory_limit value, but the changes are not being picked up. Here's some background info:

    I'm running cPanel 11.50 (but this issue was there with 11.48 also), and I'm using PHP 5.4.42 and Apache 2.4.12 on Cloudlinux. I use suPHP, and I have disabled the use of per-user php.ini files. In other words, the global php.ini file is the only one that should matter.

    When I check the output of phpinfo(), the value for memory_limit remains the same no matter how many times I restart apache — or even the whole server. And this is despite the fact that the correct php.ini file is being read.

    It's almost like the old php.ini values are cached somewhere. Could that be the case?
     
    thamtutuhoanglong likes this.
  2. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    509
    Likes Received:
    64
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    When you load the phpinfo page, there's a configuration item that you can look for that shows the loaded php.ini it's reading from. That will show you which INI is being loaded.

    I hope this helps!
     
  3. Mads Nordholm

    Mads Nordholm Member

    Joined:
    Jun 7, 2015
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Yeah, I already checked that. It's loading the correct php.ini file, but for some reason it's not parsing the changes to that file. It's quite strange.
     
  4. rackaid

    rackaid Active Member

    Joined:
    Jan 18, 2003
    Messages:
    42
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Jacksonville, FL
    cPanel Access Level:
    DataCenter Provider
    The php.ini is not being cached. suPHP does not cache any data. Once the script exits, it closes all files.

    So either:

    • The file you think is being used is not the file actually being used.
    • There are multiple directives in the php.ini being used.

    I see the second situation often and it even tripped me up on a php-fpm pool configuration yesterday. I could not get logging to work and then finally realized I missed a duplicate directive.
     
  5. Mads Nordholm

    Mads Nordholm Member

    Joined:
    Jun 7, 2015
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Good call, rackaid. That could indeed be the case, but I assure you it's not. I have been down all those roads looking for answers, but I have found none.

    However, the plot thickens now, as I have just discovered that some changes I made about 4 hours ago were just picked up. Let me explain.

    In a desparate attempt to resolve this issue, I tried to place a partial php.ini file in /usr/local/lib/php.ini.d/
    I have another partial ini file there, which I believe helped me resolve a similar issue I had a while back, when I was trying to change the timezone. At first, when I was trying earlier today, placing the extra file there had no effect at all. phpinfo() still reported the old value for memory_limit. In fact, according to phpinfo(), the extra ini file didn't even exist in that directory.

    However, now the file exists (according to phpinfo()), and appears to have been parsed!?

    Why would there be a 4 hour delay in Apache/PHP picking up on the existence of a new ini file? And why is the change not picked up instantly in the first place, when I simply make changes to the global ini file?

    I tend to prefer my plots a lot thinner than this one...
     
    #5 Mads Nordholm, Jun 23, 2015
    Last edited: Jun 23, 2015
  6. gnusys

    gnusys Active Member

    Joined:
    Jan 18, 2013
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    DataCenter Provider
    Hi,

    Are you using phpselector ?. Try switching to system php in such cases

    Thanks,
    Anoop
     
  7. The-Hookah

    The-Hookah Registered

    Joined:
    Jul 3, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    3311 145th Place,Flushing NY
    cPanel Access Level:
    Website Owner
    Why would there be a 4 hour delay in Apache/PHP picking up on the existence of a new ini file? And why is the change not picked up instantly in the first place, when I simply make changes to the global ini file?
     
  8. Mads Nordholm

    Mads Nordholm Member

    Joined:
    Jun 7, 2015
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    No, I am not using phpselector. Have been using system PHP all along.
     
Loading...

Share This Page