# How fix "php_admin_value takes two arguments" ?



## Demontager (Dec 31, 2012)

I need disable some dangerous functions in php 5.3, but per domain basis not globaly. To do so i created such config in virtual host:


```
<VirtualHost 127.0.0.1:8080>
  <IfModule mod_php5.c>
php_admin_value suhosin.executor.func.blacklist = "system, shell_exec, passthru, exec, popen, gzinflate, fsockopen, pfsockopen"
</IfModule>
    ServerName mydomain.com
    ServerAlias www.mydomain.com

    DocumentRoot "/usr/local/www/apache22/data/mydomain.com"
  <Directory "/usr/local/www/apache22/data/mydomain.com">
	Options Indexes FollowSymlinks MultiViews
	Order allow,deny
	Allow from all
  </Directory>
  <Directory /usr/local/www/apache22/data/mydomain.com>
     php_admin_value open_basedir "/usr/local/www/apache22/data/mydomain.com"
  </Directory>

    CustomLog /dev/null combined
    ErrorLog /var/log/www/mydomain.com/aerror.log

</VirtualHost>
```

When i restarted apache got an error:


```
Performing sanity check on apache22 configuration:
Syntax error on line 3 of /usr/local/etc/apache22/Includes/mydomain.com.conf:
php_admin_value takes two arguments, PHP Value Modifier (Admin)
```
Found some related articles telling that it could happened because misspeled configuration. I tried other variations (single quotes, no quotes), no effect.


----------



## Wiedmann (Dec 31, 2012)

Demontager said:
			
		

> ```
> <VirtualHost 127.0.0.1:8080>
> <IfModule mod_php5.c>
> php_admin_value suhosin.executor.func.blacklist [color="Red"]=[/color] "system, shell_exec, passthru, exec, popen, gzinflate, fsockopen, pfsockopen"
> ...


No "=" in php_admin_value.


----------



## Demontager (Dec 31, 2012)

Removed "=" and part of config as follows:

```
<IfModule mod_php5.c>
php_admin_value suhosin.executor.func.blacklist "system, shell_exec, passthru, exec, popen, gzinflate, fsockopen, pfsockopen"
</IfModule>
```
Restarted apache, yes no error, but disabled function still works. Just for test i added "phpinfo" and it working after apache restart.
Sure I added phpinfo in php.ini  as:

```
suhosin.executor.func.blacklist = "system, shell_exec, passthru, exec, popen, gzinflate, fsockopen, pfsockopen, phpinfo"
```


----------



## Demontager (Dec 31, 2012)

php -v

```
PHP 5.3.19 with Suhosin-Patch (cli) (built: Dec 30 2012 11:44:04) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH
```
phpinfo shows "This server is protected with the Suhosin Extension 0.9.33"


----------



## Demontager (Jan 1, 2013)

*SOLVED*
Oops, sorry maybe due to holidays i didn't add blocked functions in vhost config 

```
Warning: phpinfo() has been disabled for security reasons in /usr/local/www/apache22/data/mydomain.com/1.php on line 2
```


----------

