2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WordPress|php.ini設定|辿ったリンクは期限が~。アップロードサイズ上限を~

Last updated at Posted at 2020-04-29

WordPressで「辿ったリンクは期限が切れています」や「このサイトのアップロードサイズ上限を超えています」といった警告が表示された場合の対処方法について

php.ini で設定する

php.ini で下記を設定する

php.ini
; PHPの実行時間
max_execution_time = -1

; PHPに割り当てられているメモリ使用量
memory_limit = -1

; POSTデータへ許可する最大サイズ
post_max_size = -1

; アップロードファイルの最大サイズ
upload_max_filesize = -1

値を -1 にすることで無制限にすることができます。
作業が終わったら、消すなりコメントアウトするなり...

デフォルト値

なおデフォルト値は下記

php.ini
; 各デフォルト値
max_execution_time = 30
memory_limit = 128M
post_max_size = 8M
upload_max_filesize = 2M

.htaccess で設定する

共有レンタルサーバーを使っていて php.ini を触れないとか、php.ini だけでは上手くいかないとかの場合は、.htaccess へ下記を設定する

.htaccess
php_value max_execution_time 600
php_value memory_limit 50M
php_value post_max_size 40M
php_value upload_max_filesize 30M
2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?