2011-08-12 43 views
1

我在同一臺服務器上遇到Suhosin和PhpMyAdmin的問題。在閱讀文檔時:phpmyadmin.net指出我應該覆蓋phpmyadmin 的設置,例如「suhosin.request.max_vars」。我會在哪裏放這個?PhpMyAdmin和Suhosin爲Suhosin設置了選項。

在我apapche2/conf.d/phpmyadmin.conf

# Note: Please refer to /etc/apache2/sites-available/default-ssl for SSL/TLS setting. 
#Alias /phpmyadmin "/usr/share/apache2/phpmyadmin/" 
#Alias /mysql "/usr/share/apache2/phpmyadmin/" 
<Directory "/usr/share/apache2/phpmyadmin/"> 
    Options -Indexes 
</Directory> 

默認的SSL

<IfModule mod_ssl.c> 
<VirtualHost _default_:443> 
    ServerAdmin [email protected] 

    DocumentRoot /var/www/site/public 
    <Directory /> 
     Options FollowSymLinks 
     AllowOverride None 
    </Directory> 
    <Directory /var/www/> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride None 
     Order allow,deny 
     allow from all 
    </Directory> 

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
    <Directory "/usr/lib/cgi-bin"> 
     AllowOverride None 
     Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
     Order allow,deny 
     Allow from all 
    </Directory> 

    ErrorLog /var/log/apache2/error.log 

    # Possible values include: debug, info, notice, warn, error, crit, 
    # alert, emerg. 
    LogLevel warn 

    CustomLog /var/log/apache2/ssl_access.log combined 

    Alias /doc/ "/usr/share/doc/" 
    <Directory "/usr/share/doc/"> 
     Options Indexes MultiViews FollowSymLinks 
     AllowOverride None 
     Order deny,allow 
     Deny from all 
     Allow from 127.0.0.0/255.0.0.0 ::1/128 
    </Directory> 

    # Removed SSL config 

Alias /phpmyadmin /usr/share/apache2/phpmyadmin/ 
</VirtualHost> 
</IfModule> 

回答

3

想通了,這可以幫助別人:

<Directory "/usr/share/apache2/phpmyadmin/"> 
Options -Indexes 

<IfModule mod_php5.c> 
    php_value suhosin.request.max_vars 2048 
    php_value suhosin.request.max_value_length 1000000 
    php_value suhosin.request.max_array_index_length 256 
    php_value suhosin.request.max_totalname_length 8192 
    php_value suhosin.post.max_vars 2048 
    php_value suhosin.post.max_array_index_length 256 
    php_value suhosin.post.max_totalname_length 8192 
    php_value suhosin.post.max_value_length 1000000 
    php_flag suhosin.sql.bailout_on_error Off 
    php_value suhosin.log.file 0 
    php_value suhosin.log.phpscript 0 
    php_flag suhosin.log.phpscript.is_safe Off 
    php_value suhosin.log.sapi 0 
    php_value suhosin.log.script 0 
    php_flag suhosin.log.use-x-forwarded-for Off 
    </IfModule> 
</Directory> 
2

這些實際上屬於/etc/php5/conf.d/suhosin.ini

和可以被限制到下面的語句(如其它的是默認值)

suhosin.request.max_vars=2048 
suhosin.post.max_vars=2048 
suhosin.request.max_array_index_length=256 
suhosin.post.max_array_index_length=256 
suhosin.request.max_totalname_length=8192 
suhosin.post.max_totalname_length=8192 
+0

當我試圖這樣獲得: 無效的命令「suhosin.request.max_vars = 2048」,也許通過一個模塊拼寫錯誤或定義爲不包含在服務器配置中 Action'configtest'失敗。 Apache錯誤日誌可能有更多信息。失敗! –