2013-08-09 2 views
2

나는 aptitude를 통해 설치된 표준 아파치와 PHP로 데비안 스퀴즈를 실행했다.PHP는 memory_limit를 128M 이상으로 늘린다.

<?php 
echo ini_get("memory_limit")."\n"; 
ini_set("memory_limit","1024M"); 
echo ini_get("memory_limit")."\n"; 
?> 

결과 :

아니 내가 실행하려고 128M를 128M

나는이 행동과 몇 가지 사실 변경을 시도하는 것 :

/etc/php5/apache2/php.ini: 
safe_mode = Off 
memory_limit = 128M 

/etc/php5/apache2/conf.d/suhosin.ini: 
[suhosin] 
suhosin.memory_limit = 2048M 

내가이 설정을 확인할 수 있습니다 phpinfo(); service apache2 restart 이후.

메모리 제한을 128M 이상으로 설정할 수없는 이유는 무엇입니까?

참고

<?php 
echo ini_get("memory_limit")."\n"; 
ini_set("memory_limit","127M"); 
echo ini_get("memory_limit")."\n"; 
?> 

결과 : 128M 127M

종류 안부

+0

어떤 PHP 버전입니까? –

+0

php -v Suhosin-Patch (cli)가 포함 된 PHP 5.3.3-7 + squeeze16 (빌드 : Jul 17 2013 17:04:11) – user2554863

답변

2

memory_limit의 변경이 수호신 확장에 의해 차단된다. 수호신 확장을 사용하도록 설정과 http://www.hardened-php.net/suhosin/configuration.html#suhosin.memory_limit

suhosin.memory_limit

Type: Integer Default: 0 As long scripts are not running within safe_mode they are free to change the memory_limit to whatever value they want. Suhosin changes this fact and disallows setting the memory_limit to a value greater than the one the script started with, when this option is left at 0. A value greater than 0 means that Suhosin will disallows scripts setting the memory_limit to a value above this configured hard limit. This is for example usefull if you want to run the script normaly with a limit of 16M but image processing scripts may raise it to 20M.

그래서, 당신이 그것을 변경하고 아파치를 다시 시작해야합니다의 문서에서

.

+0

내 첫 번째 게시물을 보시기 바랍니다 :-) – user2554863

+0

@ user2554863, hmm just patch ! 당신은 그것을 무력화시키고 기억 한계를 시험해 보았는가, 그것이 고통이 될 것인가? – vee

+0

안녕하세요, 저는 /etc/php5/apache2/conf.d/suhosin.ini에'extension = suhosin.so'라고 말했습니다. 아파치를 다시 시작하면 작동합니다. Suhosin 버전은 : Suhosin 패치 0.9.9.1. 도움이 필요 하신가요? 나는 그것을 내버려두고 싶지 않다. – user2554863

관련 문제