boa icon indicating copy to clipboard operation
boa copied to clipboard

How best to remove a function from php "disable_functions" list?

Open leevh opened this issue 2 years ago • 3 comments

I found that Imagemagick module latest stable (3.3) on fresh vanilla Drupal 9 causes an error I think due to the function proc_get_status being disabled for security. (error here)

I'm wondering the best practice for allowing this function? It is my understanding that _PHP_FPM_DENY doesn't replace the disable_functions list, but rather adds to it. Thanks for any tips!

boa info command on Linode server: https://gist.github.com/leevh/6a83158b6272ba20dbe0b048bf27a16c

leevh avatar Mar 31 '22 00:03 leevh

re-opening, this does seem to be my issue, after more testing.

leevh avatar Apr 01 '22 05:04 leevh

Actually, I believe _PHP_FPM_DENY will replace the disable list and not add to it. From the documentation:

If _PHP_FPM_DENY is not empty, its value will replace default 'passthru', so any denied function must be listed explicitly.

reswild avatar Apr 05 '22 13:04 reswild

I just thought I'd follow up, I did not find that this works. I'm currently running a script on cron to check and remove proc_get_status from disable_functions from both /opt/php74/etc/php74.ini and /opt/php74/etc/pool.d/o1.conf. It's a hack until I figure out a better way. Thanks though!

leevh avatar Jun 22 '22 05:06 leevh

Looks like we have removed proc_get_status in October 2022. Thanks!

omega8cc avatar May 08 '23 15:05 omega8cc

Actually, I believe _PHP_FPM_DENY will replace the disable list and not add to it. From the documentation:

If _PHP_FPM_DENY is not empty, its value will replace default 'passthru', so any denied function must be listed explicitly.

_PHP_FPM_DENY will replace only passthru

omega8cc avatar May 08 '23 15:05 omega8cc