cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Give local.ini a preference in multi-php.ini editor

Hosted Power shared this idea 4 years ago
Open Discussion

As a cPanel user and a server administrator I would like local php.ini and user.ini files to override settings adjusted in the MultiPHP editor, to ensure my edits are retained.

Replies (4)

photo
1

I saw there was different behavior with php 5.6. There was even no preference added to any files. $


In 7.0 and 7.1 there is, so I think this should be fixed accordingly.


php 5.6 example:


  1. [/opt/cpanel/ea-php56/root/etc/php.d]# ls
  2. -rw-r--r-- 1 root root 53 Dec 13 14:50 bcmath.ini
  3. -rw-r--r-- 1 root root 57 Dec 13 14:50 calendar.ini
  4. -rw-r--r-- 1 root root 51 Dec 13 14:50 ctype.ini
  5. -rw-r--r-- 1 root root 49 Dec 13 14:50 curl.ini
  6. -rw-r--r-- 1 root root 47 Dec 13 14:50 dom.ini
  7. -rw-r--r-- 1 root root 49 Dec 13 14:50 exif.ini
  8. -rw-r--r-- 1 root root 47 Dec 13 14:50 ftp.ini
  9. -rw-r--r-- 1 root root 45 Dec 13 14:50 gd.ini
  10. -rw-r--r-- 1 root root 51 Dec 13 14:50 iconv.ini
  11. -rw-r--r-- 1 root root 49 Dec 13 14:50 imap.ini
  12. -rw-r--r-- 1 root root 49 Dec 13 14:50 intl.ini
  13. -rw-r--r-- 1 root root 49 Dec 13 14:50 json.ini
  14. -rw-r--r-- 1 root root 337 Dec 23 12:31 local.ini
  15. -rw-r--r-- 1 root root 57 Dec 13 14:50 mbstring.ini
  16. -rw-r--r-- 1 root root 53 Dec 13 14:50 mcrypt.ini
  17. -rw-r--r-- 1 root root 55 Dec 13 14:50 mysqlnd.ini
  18. -rw-r--r-- 1 root root 69 Dec 13 14:50 mysqlnd_mysqli.ini
  19. -rw-r--r-- 1 root root 67 Dec 13 14:50 mysqlnd_mysql.ini
  20. -rw-r--r-- 1 root root 47 Dec 13 14:50 pdo.ini
  21. -rw-r--r-- 1 root root 63 Dec 13 14:50 pdo_mysqlnd.ini
  22. -rw-r--r-- 1 root root 61 Dec 13 14:50 pdo_sqlite.ini
  23. -rw-r--r-- 1 root root 49 Dec 13 14:50 phar.ini
  24. -rw-r--r-- 1 root root 51 Dec 13 14:50 posix.ini
  25. -rw-r--r-- 1 root root 59 Dec 13 14:50 simplexml.ini
  26. -rw-r--r-- 1 root root 49 Dec 13 14:50 soap.ini
  27. -rw-r--r-- 1 root root 55 Dec 13 14:50 sockets.ini
  28. -rw-r--r-- 1 root root 55 Dec 13 14:50 sqlite3.ini
  29. -rw-r--r-- 1 root root 59 Dec 13 14:50 tokenizer.ini
  30. -rw-r--r-- 1 root root 47 Dec 13 14:50 xml.ini
  31. -rw-r--r-- 1 root root 59 Dec 13 14:50 xmlreader.ini
  32. -rw-r--r-- 1 root root 49 Dec 13 14:50 xml_wddx.ini
  33. -rw-r--r-- 1 root root 59 Dec 13 14:50 xmlwriter.ini
  34. -rw-r--r-- 1 root root 47 Dec 13 14:50 xsl.ini
  35. -rw-r--r-- 1 root root 204 Oct 6 18:40 zendguard.ini
  36. -rw-r--r-- 1 root root 47 Dec 13 14:50 zip.ini


php7 and up


  1. [/opt/cpanel/ea-php70/root/etc/php.d]# ls -al
  2. total 160
  3. drwxr-xr-x 2 root root 4096 Dec 23 12:28 ./
  4. drwxr-xr-x 6 root root 4096 Dec 15 00:18 ../
  5. -rw-r--r-- 1 root root 4033 Dec 9 2015 10-opcache.ini
  6. -rw-r--r-- 1 root root 53 Dec 13 14:48 20-bcmath.ini
  7. -rw-r--r-- 1 root root 57 Dec 13 14:48 20-calendar.ini
  8. -rw-r--r-- 1 root root 51 Dec 13 14:48 20-ctype.ini
  9. -rw-r--r-- 1 root root 49 Dec 13 14:48 20-curl.ini
  10. -rw-r--r-- 1 root root 47 Dec 13 14:48 20-dom.ini
  11. -rw-r--r-- 1 root root 49 Dec 13 14:48 20-exif.ini
  12. -rw-r--r-- 1 root root 57 Dec 13 14:48 20-fileinfo.ini
  13. -rw-r--r-- 1 root root 47 Dec 13 14:48 20-ftp.ini
  14. -rw-r--r-- 1 root root 45 Dec 13 14:48 20-gd.ini
  15. -rw-r--r-- 1 root root 51 Dec 13 14:48 20-iconv.ini
  16. -rw-r--r-- 1 root root 49 Dec 13 14:48 20-imap.ini
  17. -rw-r--r-- 1 root root 49 Dec 13 14:48 20-intl.ini
  18. -rw-r--r-- 1 root root 49 Dec 13 14:48 20-json.ini
  19. -rw-r--r-- 1 root root 57 Dec 13 14:48 20-mbstring.ini
  20. -rw-r--r-- 1 root root 53 Dec 13 14:48 20-mcrypt.ini
  21. -rw-r--r-- 1 root root 55 Dec 13 14:48 20-mysqlnd.ini
  22. -rw-r--r-- 1 root root 47 Dec 13 14:48 20-pdo.ini
  23. -rw-r--r-- 1 root root 49 Dec 13 14:48 20-phar.ini
  24. -rw-r--r-- 1 root root 51 Dec 13 14:48 20-posix.ini
  25. -rw-r--r-- 1 root root 59 Dec 13 14:48 20-simplexml.ini
  26. -rw-r--r-- 1 root root 49 Dec 13 14:48 20-soap.ini
  27. -rw-r--r-- 1 root root 55 Dec 13 14:48 20-sockets.ini
  28. -rw-r--r-- 1 root root 55 Dec 13 14:48 20-sqlite3.ini
  29. -rw-r--r-- 1 root root 59 Dec 13 14:48 20-tokenizer.ini
  30. -rw-r--r-- 1 root root 47 Dec 13 14:48 20-xml.ini
  31. -rw-r--r-- 1 root root 59 Dec 13 14:48 20-xmlwriter.ini
  32. -rw-r--r-- 1 root root 47 Dec 13 14:48 20-xsl.ini
  33. -rw-r--r-- 1 root root 47 Dec 13 14:48 20-zip.ini
  34. -rw-r--r-- 1 root root 53 Dec 13 14:48 30-mysqli.ini
  35. -rw-r--r-- 1 root root 59 Dec 13 14:48 30-pdo_mysql.ini
  36. -rw-r--r-- 1 root root 61 Dec 13 14:48 30-pdo_sqlite.ini
  37. -rw-r--r-- 1 root root 49 Dec 13 14:48 30-wddx.ini
  38. -rw-r--r-- 1 root root 59 Dec 13 14:48 30-xmlreader.ini
  39. -rw-r--r-- 1 root root 611 Oct 26 19:45 50-hosted-power.ini
  40. -rw-r--r-- 1 root root 670 Oct 26 21:17 60-customer.ini
  41. -rw-r--r-- 1 root root 337 Dec 23 12:28 local.ini


As you can see in 7.0 local.ini will always come last and will always override anything. I think it should have a preference like "40-local.ini" for example.


This way it will be possible to choose other files which can override it.

photo
2

Same here, the .ini file created by MultiPHP ini editor overrides our own "hierarchy". There should be a solution to have a single ini file that has higher precedence as all other cPanel "default" ones.

photo
2

With PHP-FPM, we are unable to easily use a custom per-user php.ini file. The FastCGI backend that PHP-FPM uses simply does not allow. This means that "MultiPHP INI Editor" is almost useless to in this situation (With PHP-FPM enabled).

An alternative is to use the ".user.ini" custom feature that PHP allows for.

So, if the domain has FPM enabled will be interesting that the "MultiPHP INI Editor" creates a .user.ini file (instead the php.ini) with the configured values.

photo
1

Last night our cPanel WHM server automatically updated to version 64. As a result PHPs "allow_url_fopen" was disabled, because local.ini was changed. This should never be able to happen, how can I otherwise rely on the automatic updates.

Leave a Comment
 
Attach a file