LoginSignup
1
1

More than 5 years have passed since last update.

PHPでファイルのアップロードができないときに試してみること

Posted at

php.iniを確認する

php.ini書き出し
phpinfo();

表示された表の中から

  • memory_limit
  • post_max_size
  • upload_max_filesize

の数値を確認します

memory_limit

PHP自体のメモリが足りない場合は上限を増やしましょう。

-- memory_limit = 128M
++ memory_limit = 256M

post_max_size

一回でアップロードされるファイルの全ての合計サイズに関わる設定です
こちら、memory_limitより大きくはしないように注意しましょう
※デフォルトで2MBとなっている場合があります

-- post_max_size = 2M
++ post_max_size = 20M

upload_max_filesize

一ファイルあたりの最大アップロードサイズに関わる設定です
こちらも、memory_limitより大きくはしないように注意しましょう
※デフォルトで2MBとなっている場合があります

-- upload_max_filesize = 2M
++ upload_max_filesize = 20M

他の方法が分かり次第、追記

1
1
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1