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 is read from wrong location

Discussion in 'EasyApache' started by DennisMidjord, Apr 4, 2017.

  1. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    Sorry if this is misplaced, but we've just upgraded to EA4 to serve one of the benefits - a seperate php.ini for each domain.
    However, it seems like this is not working for us. When looking through a websites phpinfo, I saw that the loaded configuration was from /opt/cpanel/ea-php55/root/etc/php.ini. What are we doing wrong?

    We're using CloudLinux.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    No, we're using MultiPHP provided by cPanel. I know how we should edit the files, but the problem is that phpinfo shows that the webserver loads a global php.ini configuration (/opt/cpanel/ea-php55/root/etc/php.ini in case it's PHP5.5)
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Could you confirm which steps you have taken to utilize a custom php.ini file? For instance, did you upload a php.ini file to the account? What PHP handler is enabled for the version of PHP assigned to the account?

    Thank you.
     
  5. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    On the clients cPanel account, we opened MultiPHP INI Editor and changed the values needed (both for the domain and home folder). This didn't work, so I tried opening the ini files manually to see if the values had been set - they had. The php.ini file wasn't used, though.

    We're using cgi as handler.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know which version of cPanel is installed on this system? You can check with a command such as:

    Code:
    cat /usr/local/cpanel/version
    Thank you.
     
  7. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    We're using v 11.62.0.19.
    We're also running Litespeed - I don't know if that is a problem?
     
  8. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can find LiteSpeed's documentation on per-user php.ini changes at:

    litespeed_wiki:php:per-user-php-ini [LiteSpeed Wiki]

    Let us know if this helps.

    Thank you.
     
  10. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    As mentioned in my first post, we're also using CloudLinux. The website states the following: This document lists the options for enabling a per-user php.ini when you are not running CloudLinux.

    Instead, we should be using this: CloudLinux Documentation
    I'm a bit curious, though. If we use that method, would users then still be able to use MultiPHP? Also, any way that we could make WHM/cPanel create the file /etc/cagefs/custom.etc/USER_NAME/php.ini once the user is created?
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    It's possible to still use the MultiPHP functionality per the information from this document:

    PHP Selector > Control Panel Integration > cPanel

    The above document goes into detail about how PHP Selector interacts with MultiPHP.

    You could create a custom bash script that creates the directory and populates the file with the entries of your preference. Then, to ensure it's ran automatically upon account creation, configure it to run as a post Accounts::Create hook:

    Tutorial - Create a Standardized Hook - Software Development Kit - cPanel Documentation
    Guide to Standardized Hooks - Whostmgr Functions - Software Development Kit - cPanel Documentation

    Thank you.
     
Loading...

Share This Page