PHP 実験室 【覚書 メモリ不足?】

なんだかよくわからないが作ったものが動かない(この文章もいい加減不明過ぎ)。エラーを出力させてみると以下のような文言。

Fatal error: Allowed memory size of 8388608 bytes exhausted 
                               (tried to allocate 11251014 bytes) 
in /home/piyo/html/private_html/cgi-bin/piyo.php on line 410

ちなみに該当行は「$comm = strip_tags($comm);」こんな処理。まぁエラーメッセージだけ見ればメモリ不足なんでたちまち以下の方法で回避。修正したのは「/etc/php.ini」。

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing...
memory_limit = 8M       ; Maximum amount of memory a script may consume (8MB)
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 120    ; Maximum amount of time each script may spend parsing...
memory_limit = 32M      ; Maximum amount of memory a script may consume (8MB)

確かにエラーは出なくなったが、本当にこれで良いのか・・・。コードの見直しが先決っぽいがとりあえず放置。