Jun 16, 2010

php.ini のファイルアップロード関係のディレクティブを上書き変更する方法

How to Override the directives about file upload in php.ini.
(php.ini のファイルアップロード関係のディレクティブを上書き変更する方法)
The directives about file upload
max_execution_time "30" "60"PHP_INI_ALL
post_max_size "8M" "20M"PHP_INI_PERDIR
upload_max_filesize "2M" "10M" PHP_INI_PERDIR
Where is the directives set in ?
CHANGEABLE Where is it set ?
PHP_INI_PERDIRphp.ini .htaccess httpd.conf
Sample part of httpd.conf. We need "AllowOverride Options".
(httpd.confの抜粋例、"AllowOverride Options"を指定が必要です。)
DocumentRoot "/var/www/html"
<Directory />
    Options FollowSymLinks
    #AllowOverride None
    AllowOverride Options
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    #AllowOverride None
    AllowOverride Options
    Order allow,deny
    Allow from all
Sample .htaccess
<IfModule mod_php5.c>
  php_value max_execution_time "60"
  php_value memory_limit "256M"
  php_value post_max_size "20M"
  php_value upload_max_filesize "10M"
Re-start httpd(apache)
(httpd(apache) の再起動方法)
service httpd restart