disallow functions in php.ini

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oceanwave
    Member
    Forum Explorer
    • Dec 2024
    • 33

    #1

    disallow functions in php.ini

    I'm trying to allow ini_set for one alt php version (8.3) while disabling it by default in most versions.

    If I go to WHM 130.0.17 MultiPHP INI editor -> Editor Mode tab -> Select version alt-php83 and remove ini_set from disable_functions, and hit the blue save button, I get a green popup that says my changes are saved. But if I go back to MultiPHP INI Editor and repeat the process, when I go to the Editor Mode tab I can see that ini_set did not in fact get removed form the disable_functions line, even though it said changes had been saved. (and it is still disabled on an individual site running alt php 8.3)

    If I go via ssh and manually nano /opt/alt/php83/etc/php.ini and remove ini_set from disable_functions line and save, then ini_set is no longer disabled for the individual site running alt php 8.3

    However, it seems at some interval, that change is being overwritten an hour or so later.

    Quesion:
    1.) Why is WHM suddenly not saving the edit from Editor Mode for alt php php.ini?
    2.) Is there a different place to edit via ssh -- where is /opt/alt/php83/etc/php.ini being generated from that can be edited so it doesn't get overwritten?
  • bogdan.sh
    Administrator
    • Nov 2016
    • 1273

    #2
    Hello,
    Sorry for taking a bit to get back to you, I still need some more time to test things out.

    Are you sure you want to allow ini_set for just that one PHP version? It seems a bit risky since all the customers on that version would be affected. I guess you need it just for one customer and if so a simpler solution would be to subsitute the php.ini for that user only, which should work right away: https://docs.cloudlinux.com/cloudlin...th-easyapache4

    Comment

    • oceanwave
      Member
      Forum Explorer
      • Dec 2024
      • 33

      #3
      Thanks - that will work. Appreciated!

      (I also figured out what I was doing wrong. In the past, I thought that I could specify disable_functions in the global.ini and that the individual version ini would override if specified in the individual version ini. However now whatever is set in the global ini is read by cpanel's MultiPHP INI editor and written to the individual alt php version ini files such as /opt/alt/php83/etc/php.ini every so often. So removing the whole disable_functions line from the global ini and inserting it in eac individual /opt/alt/version-number/etc/php.ini allows a different value for different alt-php versions. )

      Comment

      Working...