Koozali.org: home of the SME Server

How to allow system() calls in PHP scripts?

Offline holck

  • ****
  • 317
  • +1/-0
How to allow system() calls in PHP scripts?
« on: November 06, 2022, 08:40:04 PM »
I run an installation of Piwigo, an image gallery written in PHP (https://piwigo.org). Mostly it runs fine, but there is a plugin giving me problems. I get error messages like this:
Code: [Select]
Warning: system() has been disabled for security reasons in /home/e-smith/files/ibays/Primary/html/photos/plugins/piwigo-videojs/include/function_dependencies.php on line 38
I've checked the wiki (https://wiki.koozali.org/PHP), and according to this, I should be able to adjust the "DisableFunctions" property in the configuration database:
Code: [Select]
/sbin/e-smith/config setprop php74 DisableFunctions none
/sbin/e-smith/signal-event webapps-update

But this doesn't seem to have any effect. The file /etc/opt/remi/php74/php.ini has an empty setting for display_functions:
Code: [Select]
...
disable_functions                      =
...
......

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: How to allow system() calls in PHP scripts?
« Reply #1 on: November 06, 2022, 10:40:49 PM »
every ibay uses its own php-fpm pool. 
you need to alter the setting for this pool.

the easy and short way is to install smeserver-webhosting and then alter the DisableFunctions from there.  do not empty the string or delete the property there or it will be default to disable the most dangerous functions as default.

you can set it with only the ones you want to leave disable or set a random string there to disable nothing.

Offline holck

  • ****
  • 317
  • +1/-0
Re: How to allow system() calls in PHP scripts?
« Reply #2 on: November 06, 2022, 10:50:13 PM »
Thanks for quick reply! I have indeed installed smeserver-webhosting, but also forgotten about it. But it doesn't let met modify the settings for the primary i-bay, where Piwigo is installed. How do I change settings for the primary i-bay?
......

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: How to allow system() calls in PHP scripts?
« Reply #3 on: November 07, 2022, 08:45:45 AM »
db accounts setprop Primary Modifiable yes