Allow shell_exec on one (sub) domain

ericosman

Verified User
Joined
Nov 25, 2019
Messages
630
Location
Weert
Hi All,

Does anyone have an idea how i can allow shell_exec on one single domain / user?
I tried looking on the forum but could not find any way to allow it..
 
Hello,

I believe it was already discussed here. You might check the results:

- https://www.google.com/search?q=individual+disable_functions+site:forum.directadmin.com

If to speak in general:

disable_functions can only be set once in the main php.ini file, and cannot be overridden by other areas, but this varies per php-mode. php-modes like php-fpm/fastcgi are much more stand-alone php instances, so you can get away with these types of overrides, away from the main php.ini.

- https://docs.directadmin.com/webservices/php/php-options.html
- https://docs.directadmin.com/webservices/php/secure-php.html#custombuild-secure-php
 
PHP-FPM,
For single domain, you can do something like this using "Custom HTTPD Configurations"

For Apache
Code:
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "memory_limit=256M"

For Nginx
Code:
fastcgi_param PHP_ADMIN_VALUE "memory_limit=256M";

I'm not sure, it's can or can't overwrite "disabled_functions" without remove from "php.ini", because normally php-fpm config can't overwrite disable_functions if it's exists.
 
I'm not sure, it's can or can't overwrite "disabled_functions" without remove from "php.ini", because normally php-fpm config can't overwrite disable_functions if it's exists.

In practice it would mean for PHP-FPM: remove disable functions from php.ini and add them in PHP-FPM.conf template file with a possibility to overwrite at admin level. I'm sure, I already posted more details about it on the forums. So it is a matter to find the thread only.
 
Well, i allowed shell_exec for all users, now the only thing is that i have to allow whois, dig and git in open_basedir somehow...
 
Back
Top