PHP max_input_vars
내가지고있어 max_input_vars
오류 메시지.
php.ini
버전 5.3.9부터이를 변경할 수 있는 설정이 있음을 이해 하지만 버전 5.1.6을 실행하고 있습니다.
5.1.6 서버에 대한 구성 정보를 보면 max_input_vars
값이 1000으로 표시됩니다.
내 질문은 : 5.1.6을 실행하고 phpinfo()
있지만 이 설정이 표시 되지만 php.ini
파일에 없습니다 . 이 값이이 버전의 PHP에서 하드 코딩되어 변경할 수 없음을 의미합니까?
php.ini에 추가 할 수 있으며 작동합니다. PHP 5.3.6에서 테스트했습니다.
PHP net에 대한 참조 :
http://php.net/manual/en/info.configuration.php#ini.max-input-vars
음, 당신은 기능을 런타임에서이 지시어를 설정할 수 없습니다하십시오 ini_set(name, newValue)
, 예를 들어,
ini_set('max_input_vars', 3000);
이거 작동 안 할거야.
문서에 설명 된대로이 지시문은 디렉토리 범위별로 만 설정할 수 있습니다. 즉, .htaccess 파일, httpd.conf 또는 .user.ini (PHP 5.3 이후)를 통해 설정할 수 있습니다.
http://php.net/manual/en/configuration.changes.modes.php 참조
php.ini에 지시문을 추가하거나 .htaccess에 다음 행을 배치하면 작동합니다.
php_value max_input_vars 3000
php_value suhosin.get.max_vars 3000
php_value suhosin.post.max_vars 3000
php_value suhosin.request.max_vars 3000
5.3.3에서이 수정을 시도했지만 변경 사항이 없습니다. 인터넷 검색을 통해이 웹 페이지 http://anothersysadmin.wordpress.com/2012/02/16/php-5-3-max_input_vars-and-big-forms/에서 서버가 Suhosin 패치를 사용 하는 경우 변경해야하는 다른 설정을 자세히 설명했습니다. 데비안에서 아파치가하는 일입니다.
이 사이트는 다음을 설명합니다.
따라서이 숫자를 기본 숫자 인 1000에서 3000으로 늘리려면 php.ini에 다음 줄을 입력해야합니다.
max_input_vars = 3000 suhosin.post.max_vars = 3000 suhosin.request.max_vars = 3000
나는 그것을 테스트했지만 (/ etc / php5 / apache2 및 / etc / php5 / cli에서 php.ini에 설정을 추가하고 Apache를 성공적으로 다시 시작했습니다) phpinfo에는 여전히 max_input_vars 변수가 없습니다.
몇몇 사이트는이 변경이 적용될 첫 번째 PHP 버전으로 PHP 5.3.9를 가리키고 있습니다. 따라서 5.3.3 이상의 버전에서 작동하는 사람들을보고 싶은데 관심이 있지만 RTM이 제대로되지 않은 것에 대한 제 잘못입니다. 그러나 5.3.9 미만.
php.ini 파일에서 max_input_vars 값의 주석을 해제하고 값을 늘려야합니다 (exp. 2000). 서버를 다시 시작하는 것도 잊지 마십시오. 이것은 99,99 %에 도움이됩니다.
2018 년이되었고 .NET Framework를 초과하는 요청을 보내야 할 때이 문제에 막혔습니다 max_input_vars
. 그리고 나는 나와 같은 newie가 max_input_vars
매개 변수를 변경 한 후 php fpm 서비스를 다시 시작하는 것을 잊은 솔루션을 생각해 냈습니다 . apache2
서비스 를 다시 시작하려고 했지만 php fpm이 아니기 때문에
- 코드를 주석 해제
/etc/php/7.0/fpm/php.ini
하고 원하는대로 번호를 설정 하십시오.
max_input_vars = 4000
- php 7을 사용하므로 php fpm 서비스를 다시 시작하십시오. 따라서,
sudo service php7.0-fpm restart
테스트에 도움이 되었기 를 바랍니다 Debian Stretch
.php7.0
이 지시문을 사용하면 해시 충돌을 사용하는 서비스 거부 공격의 가능성이 줄어 듭니다. 이 지시문에 지정된 것보다 많은 입력 변수가있는 경우 E_WARNING이 발행되고 추가 입력 변수가 요청에서 잘립니다.
기본값 인 1000을 확장하지 않고 요청을 직렬화하거나 블록 단위로 요청을 전송하여 애플리케이션 기능을 확장하는 것을 제안 할 수 있습니다. 그렇지 않으면 필요한 구성으로 확장 할 수 있습니다.
확실히 php.ini에서 설정해야합니다.
Centos6에서 작동하던 "php.ini"가 아닌 Centos7의 ".user.ini"파일에이 파일을 넣어야합니다. 하위 디렉토리에만 ".user.ini"를 배치하여 해당 디렉토리에만 영향을 줄 수 있습니다.
.user.ini :
max_input_vars = 3000
Centos7 및 PHP 5.6.33에서 테스트되었습니다.
php_value max_input_vars 6000
"사이트의 .htaccess 파일에이 줄을 넣으십시오."
New Cpanels block to see the .htaccess file or if you add a .user.ini you wont be able to see it. but with a little hack you can make it work. Edit for example wp-config.php and in the URL bar replace wp-config.php by .htaccess now you can paste the values and save it. enter image description here
Just had the same problem adding menu items to Wordpress. I am using Wordpress 4.9.9 on Ubuntu 18.04, PHP 7.0. I simply uncommented the following line and increased it to 1500 in /etc/php/7.0/apache2/php.ini
; How many GET/POST/COOKIE input variables may be accepted<br>
max_input_vars = 1500
Then used the following to effect the change:
sudo apache2ctl configtest #(if it does not return ok Apache will not start)
sudo service apache2 reload
Hope that helps.
"PHP message: PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.
This php configuration parameter max_input_vars will affect not only your GET / POST / COOKIES parameters it also controls your any Form Input.
To set or change its value follow the below steps.
1) check the existing setting / value by viewing it in your php.ini file Locate php.ini file by using
<?php echo getinfo(); ?>
find below key: Loaded Configuration File : /etc/php/5.6/fpm/php.ini
2) Open the php.ini file in editable mode and do search for max_input_vars This line may be commented in your existing default setting with default value of 1000 , So remove ; to uncomment it and Edit it with your suitable value e.g. 2500.
3) Save the file and Restart the Services of PHP by using below sudo service php5.6-fpm restart
Similarly you can update any other similar PHP Configuration to your ease.
Yes, add it to the php.ini, restart apache and it should work.
You can test it on the fly if you want to with ini_set("max_input_vars",100)
참고URL : https://stackoverflow.com/questions/10303714/php-max-input-vars
'code' 카테고리의 다른 글
Android의 16 진수 색상은 8 자리 숫자입니다. (0) | 2020.10.16 |
---|---|
특정 속성에 대한 최대 값을 가진 Ruby 배열의 요소 찾기 (0) | 2020.10.16 |
Windows에서 "import tensorflow"를 실행하면 "_pywrap_tensorflow"라는 모듈 없음 오류가 생성됩니다. (0) | 2020.10.16 |
SQL Server에서 쿼리 시간 제한 강제 (0) | 2020.10.16 |
Android SeekBar 최소값 (0) | 2020.10.16 |