custom suhosin settings

redjersey

Verified User
Joined
Apr 22, 2013
Messages
100
Location
Toronto, Canada
I'm using php 5.6 (mod_php) with suhosin

I would like to use suhosin.executor.func.blacklist to disable certain php functions and only allow those functions for certain domains.

so I have created: suhosin.ini in /usr/local/directadmin/custombuild/custom/suhosin/
and set:
suhosin.executor.func.blacklist = "exec, passthru... ...."

when I rebuild php using custombuild, it works, those functions are blocked.

now I would like to allow those functions for certain domains, so based on help: https://help.directadmin.com/item.php?id=622 I have created:

/usr/local/lib/php.conf.d/30-mydomain.com.ini
and add
[HOST=mydomain.com]
suhosin.executor.func.blacklist = ""

and it's not working, for instance I can't use exec() on mydomain.com

any one knows how to fix it?
 
add in php script:

PHP:
error_reporting(E_ALL);
ini_set('display_errors', 1);

and show what error you have when you try to execute PHP exec().
 
I have "sort of" fixed the problem.

instead of creating 30-mydomain.com.ini

I have added:

<IfModule mod_php5.c>
php_value suhosin.executor.func.blacklist passthru
</IfModule>

(php_value suhosin.executor.func.blacklist cannot be empty so i'll just put a function that i never use)

in directadmin Httpd.conf Customization (custom 3 box)

and it's working now, but I still wonder why 30-mydomain.com.ini is not working??
 
Is 30-mydomain.com.ini shown in
PHP:
phpinfo();

With PHP-FPM 5.6 the following worked for me:

Code:
; disabled globally for all hosts
suhosin.executor.func.blacklist=exec


; enabled for one domain
[HOST=example.com]
suhosin.executor.func.blacklist=
memory_limit=256M

in /usr/local/php56/lib/php.conf.d/99-custom.ini
 
I don't have a server with mod_php for testing, so I don't have anything to add. Probably later or somebody else can help you with it.
 
ok, thanks
not only suhosin not working on 30-mydomain.com.ini but also other settings like memory_limit=256M not wokring ie. the memory limit is still set as default (128m)
 
Back
Top