LoginSignup
1
0

More than 5 years have passed since last update.

ファイルサイズが大きくてPHPでPOSTできない時の対処法

Last updated at Posted at 2019-01-05

0.はじめに

環境:PHP 7.0、Apache
動画などの大きなファイルをphpサーバーにPOSTしたときに、なぜがPOSTできない現象が発生。
エラーメッセージ等も出ていなかった。
調べてみると、サーバーのphp.iniによるアップロードファイルの最大容量がデフォルトでは、2M程度となっており、
php.iniの設定を変更する必要があるとのこと。

1.php.iniの設定を変更

以下の3箇所の設定を変更すればいいようだ。

;メモリ使用量の上限
memory_limit = 100M

;POSTデータの最大サイズ ※合計サイズ
post_max_size = 100M

;1ファイルあたりの最大アップロードサイズ
upload_max_filesize = 100M

php.iniを更新した後はAapachサーバーの再起動が必要です。

$service httpd restart
又は
$sudo /etc/init.d/apache2 restart

2.参考にしたURL

https://www.php-factory.net/trivia/05.php
https://qiita.com/macer_fkm/items/dda5e343e19c432a1ccd
http://raspberry.blog.jp/archives/3141444.html
http://raining.bear-life.com/linux/php-ini%E3%81%AE%E8%A8%AD%E5%AE%9A%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%97%E3%80%81%E5%8F%8D%E6%98%A0%E3%81%95%E3%81%9B%E3%82%8B

1
0
0

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
0