Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressのHTTP画像アップロードエラーを修正する方法

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressのHTTP画像アップロードエラーを修正する必要がありますか?

このエラーは、WordPressでコンテンツを作成しているときに特にイライラさせられます。通常、WordPressのビルトインメディアライブラリを使って画像やその他のファイルをCMSにアップロードしているときに発生します。

この投稿では、WordPressのHTTP画像アップロードエラーを簡単に修正する方法を紹介します。

How to fix http error when uploading images in WordPress

WordPressでメディアアップロード中にHTTPエラーが発生する原因は?

WordPressメディアアップローダーを使用してWordPressサイトにファイルをアップロードしようとすると、多くのことがHTTPエラーにつながる可能性があります。

基本的に、WordPressは原因を突き止めることができず、そのために一般的な「HTTPエラー」メッセージが表示される。

HTTP Error

このWordPress HTTPエラーのもどかしい点は、エラーの原因について何の手がかりも与えてくれないことです。つまり、原因を見つけてエラーを修正するために、さまざまな解決策を試さなければならないのです。

ということで、WordPressでメディアアップロード中のHTTPエラーをトラブルシューティングして修正する方法を見ていきましょう。以下のリンクから特定の方法に飛べます:

方法1:HTTPエラーが一時的なものではないことを確認する

まず、数分待ってから、WordPressサイトに画像ファイルを再度アップロードしてみてください。このエラーは、異常なトラフィックやサーバーリソースの低下によって発生することがありますが、ほとんどのWordPressホスティングサービスでは自動的に修正されます。

それでもうまくいかない場合は、以下のうち1つ以上を試してみるといいだろう:

  • ブラウザーを更新するか、ブラウザーのキャッシュをクリアしてください。
  • ファイルサイズを変更してファイル名を変更し、メディアライブラリに再度アップロードします。ファイルサイズを小さくする画像最適化プラグインのリストをご覧ください。
  • 別のフォーマットで保存する。例えば、画像編集ソフトを使ってJPEGをPNGに変更することができます。その後、ファイルのアップロードを再試行してください。

これらの手順をすべて踏んでもHTTPエラーが発生する場合は、一時的な不具合によるエラーではないため、早急に対処する必要があります。

方法2:すべてのプラグインと現在のテーマを無効化する

WordPressのプラグインを新規インストールしたばかりの場合、他のプラグインとの互換性がなく、画像のアップロードプロセスが中断される可能性があります。この場合、WordPressのプラグインをすべて無効化してください。

WordPressプラグインを無効化するとHTTPエラーが消える場合、そのプラグインがHTTPアップロードイメージエラーの原因である可能性があります。別のプラグインをインストールするか、開発者に連絡してサポートを受けてください。

詳しくは、WordPressプラグインをすべて簡単に無効化する方法とWordPressダッシュボードにアクセスできないときにプラグインを無効化する方法のガイドをご覧ください。

Bulk deactivate all WordPress plugins

同様に、テーマのコンフリクトが画像のアップロードプロセスを妨害することもあります。テーマには、WordPressがメディアアップローダーを処理する方法を妨害するような機能が含まれていることがあります。

幸いなことに、テーマの衝突を特定するのは比較的簡単です。一時的にデフォルトのWordPressテーマに切り替えることができます。詳しくは、WordPressテーマを適切に変更する方法をご覧ください。

Activating a default WordPress theme

デフォルトテーマを有効化したら、もう一度画像をアップロードしてみてください。エラーが消えた場合は、現在のテーマに問題がある可能性が高いです。この場合、テーマの更新が可能かどうかを確認することができます。多くの場合、更新によって互換性の問題やバグが修正されます。

あるいは、テーマ開発者にサポートを求めることもできます。パッチを提供してくれるかもしれませんし、競合を解決するためのガイダンスを提供してくれるかもしれません。

方法3:WordPressのメモリ制限を増やす

WordPressはPHPプログラミング言語で書かれています。さらに、異なるPHPプロセスに割り当てられるメモリの量は、Webホスティングサーバーによって決定されます。

画像のアップロードにPHPメモリが必要な場合、WordPressでHTTP画像アップロードエラーが表示されることがあります。

これを解決するには、サーバー上でPHPが使用できるメモリを増やす必要があります。

まず、FTPクライアントまたはウェブホスティングダッシュボードのファイルマネージャーアプリを使用して、サイトのファイルにアクセスする必要があります。次に、ルートディレクトリに移動し、wp-config.phpファイルを見つけます。

Edit wp-config file

その後、テキストエディターを使ってwp-config.phpファイルを編集し、以下の行を追加する必要があります:

define( 'WP_MEMORY_LIMIT', '256M' );

このコードはWordPressのメモリ制限を256MBに増やし、メモリ制限の問題を解決するのに十分だろう。

最後に、ファイルを保存してサーバーにアップロードしなければならない。

さらに詳しく知りたい方は、WordPressのPHPメモリ制限を増やす方法のステップバイステップガイドをご覧ください。

方法4:WordPressが使用するイメージエディターライブラリを変更する

WordPressはPHPで動作し、画像を扱うために2つのモジュールを使用します。これらのモジュールはGDライブラリとImagickと呼ばれます。WordPressは、利用可能なモジュールによってどちらかを使用します。

しかし、Imagely はメモリの問題にしばしば遭遇し、画像のアップロード中に HTTP エラーが発生します。これを解決するには、GD ライブラリを画像エディタの初期設定にします。

WordPressテーマのfunctions.phpファイルにこのコードを追加するか、WPCode(推奨)を使用するだけで実行できます:

function wpb_image_editor_default_to_gd( $editors ) {
	$gd_editor = 'WP_Image_Editor_GD';
	$editors = array_diff( $editors, array( $gd_editor ) );
	array_unshift( $editors, $gd_editor );
	return $editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );

詳しくは、WordPressでカスタマイザーコードを追加する方法をご覧ください。

このコードを追加した後、メディアアップローダーを使用してファイルのアップロードを再試行できます。それでも問題が解決しない場合は、このコードを削除して、この投稿に記載されている他の方法を試してください。

方法5:.htaccessを使う

この方式では、Imagick がサーバーリソースをどのように使用するかをコントロールできます。多くの共有ホスティングサービスでは、画像処理を高速化するために Imagick が複数のスレッドを使用することを制限しています。しかしその結果、画像をアップロードする際に HTTP エラーが発生することになります。

簡単な方法は、.htaccessファイルに以下のコードを追加することです:

SetEnv MAGICK_THREAD_LIMIT 1

このコードは、Imagick が画像処理に使用するスレッドを個別に制限するだけです。

方法6:PHPのバージョンを更新する

WordPressサイトが古いバージョンのPHPを使用している場合、HTTP画像アップロードエラーが発生する可能性があります。新しいバージョンのPHPはパフォーマンスが向上しており、一般的にメモリ使用量が少ないからです。

幸いなことに、サイトのPHPバージョンをチェックして更新するのは簡単です。詳しくは、WordPressでPHPのバージョンを更新する方法についての初心者向けガイドをご覧ください。

方法7:ファイルとフォルダーの権限を確認する

WordPress が正しく機能するためには、特定のファイルやフォルダーの権限に依存しています。権限が正しくない場合、WordPressがファイルにアクセスしたり変更したりできなくなり、アップロードエラーにつながる可能性があります。

例えば、アップロードディレクトリに適切な書き込み権限がない場合、WordPressはアップロードした画像を保存できません。

正しい権限を確認するには、WordPressのファイルとフォルダーの権限エラーを修正する方法をご覧ください。

方法8:デバッグモードを有効化する

PHPの根本的なエラーがHTTP画像アップロードエラーとして現れることがあり、トラブルシューティングを困難にしています。

WordPressの設定でデバッグモードを有効化すると、デバッグログにPHPエラーが表示され、アップロードの問題の根本的な原因に関する貴重な手がかりが得られます。

WP_DEBUGモードを有効にする方法については、WordPressのデバッグモードを有効にする方法の投稿を参照してください。このガイドでは、必要なコードを wp-config.php ファイルに追加する手順を順を追って説明します。

方法9:ホスティングサービスのリソースをチェックする

お客様のサイトがストレージ容量に達した場合、またはサーバーリソースに制限が発生した場合、アップロードエラーが発生する可能性があります。たとえば、ディスク容量が不足していると、WordPress が画像のアップロードに必要な新しいファイルやフォルダーを作成できないことがあります。

ほとんどのホスティングサービスプロバイダは、ディスク容量を含む、あなたのウェブサイトのリソースの使用状況を表示することができますコントロールパネルを提供しています。表示されない場合は、ホスティングサービスプロバイダーのサポートチームにお問い合わせください。

ストレージの上限が近づいている場合は、リソースの最適化を検討してください。例えば、大きな画像ファイルはストレージを大量に消費します。アップロードする前に画像を最適化してファイルサイズを小さくすることができます。

リソースの最適化だけでは不十分な場合は、より多くのストレージ容量を持つホスティングプランへのアップグレードを検討してください。これにより、サイトのファイルに必要な容量が追加されます。

あなたは寛大なストレージ容量を持つ信頼性の高いWordPressホスティングサービスプロバイダを探しているなら、Bluehostは人気のオプションです。彼らはさまざまなサイトのニーズに合わせて様々なプランを提供しています。

Bluehost website

この投稿がWordPressのHTTP画像アップロードエラーの修正にお役に立てば幸いです。WordPressのよくあるエラーとその対処法、ブロックエディターのよくある不具合もご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

175件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Greg Zelt says

    FANTASTIC!!! Every other search I did yielded nothing.

    Godaddy hosting with wordpress installed. Killing imagick did the trick. My lightroom plugin is functioning like a trooper now.

    Thank you so much, just had to share with you.

  3. George says

    Hi,
    I started having this HTTP uploading error for images that are larger than 600x900px . The size in KB doesn’t matter – 100KB or 300KB – they are uploading just fine if they are less then 600×900.

    I have tried all the methods you described without success.

    Do you think that changing the theme can help?

    • WPBeginner Support says

      You would first want to reach out to your hosting provider to ensure you are not running into a safety measure from their end that would cause the error.

      管理者

      • George says

        Thanks!
        I called them before posting my question – they told me to contact WP support. To me, it also looks like they installed something on their server but are not willing to admit it.
        I’ll call again.

  4. DAMIAN says

    The functions.php method worked for me. I’ve been trying to fix that for months! You saved me a lot of time. Thank you!!!

    • WPBeginner Support says

      You would likely need to reach out to your hosting provider and they should be able to help solve the issue

      管理者

  5. AG says

    Tried all the above and no luck. My issue is only mp3 files, I get the http error. Contacted my hosting provider and they could find nothing wrong. Images upload fine. What am I missing?

    • WPBeginner Support says

      For MP3 files you may need to increase the memory limit to 512 in case it is due to how large the files are

      管理者

  6. Stacey says

    Number 3 worked for me! Thank-you so much, that was so frustrating before. You’re site is always so helpful :)

  7. Mark R says

    Thank you so much, I went through all four steps but nothing worked. I went back to step 1 and increased it from 256mb to 512mb which solved the problem.

    • WPBeginner Support says

      Glad our guide could help be a part of the solution and you were able to get it resolved :)

      管理者

  8. KKervin says

    Option #3 worked for me to resolve the HTTP error.

    I installed the code snippets plugin and copied the code from here. It worked perfectly the first attempt.

    Thank you!

  9. yoeri says

    Also just check the name of your image you want to upload.
    Make it simple as this has done the trick for me on multiple occasions.

    • WPBeginner Support says

      Have you reached out to your hosting provider to see if there are any errors on their end?

      管理者

  10. Jen Niles says

    None worked above and then we realize our dev site needed to change the Home and Site URL in General Settings in WP Admin from http:// to https:// then it worked! :D

  11. Marek says

    None of these worked in my case. Mod security was the cause. I had to temporarily disable mod security on my web server.

    • WPBeginner Support says

      Thanks for sharing what worked for you if other users run into this problem. For most users, they will need to reach our to their hosting provider for assistance in editing mod security

      管理者

  12. JJ says

    SOLVED: my pdf files that would not upload into the Word Press media library with HTTP Error had file names with a semi-colon in them. I deleted the semi-colon and it uploaded just fine. Semi-colons are legal characters in Word docs and pdf files, but apparently won’t upload to Word Press for reasons beyond my knowledge. ; ; ; ;

    • WPBeginner Support says

      Thanks for sharing that solution for anyone else running into that problem :)

      管理者

    • WPBeginner Support says

      If none of these methods worked, have you tried reaching out to your hosting provider to see if they can see an error on their end?

      管理者

  13. Erin says

    Method #4 worked for me. It seems my host was limiting the plugins processing power. Thanks for sharing these solutions.

  14. Brad says

    Another common problem for this is that you used an apostrophe in the file name. I just encountered this problem :)

  15. George R says

    I have tried all the methods as mentioned above but none of these worked for me. So I contacted the service provider. They resolve the issue.
    They have refreshed and whitelist another IP for me and it works.
    Hope this may help for you too.

    • WPBeginner Support says

      Have you reached out to your hosting provider to ensure they don’t see any errors on their end?

      管理者

  16. love says

    don’t need to follow all step you just need to re-login your website and clear your temp files, that ok

    • WPBeginner Support says

      For some people maybe, for others, they do require all of the steps in the article. :)

      管理者

  17. Sandy says

    I tried Option 3. Now my entire home page is blank. Individual pages are still there. The Sidebar is still visible, but the rest of the home page is blank.

    Please help if possible.

    Thank you,
    Sandy

    • WPBeginner Support says

      You may want to ensure you didn’t change your homepage settings while troubleshooting and have you removed the code to see if that solved the missing content?

      管理者

    • WPBeginner Support says

      You may want to try disabling your plugins to see if one of your plugins could be slowing the admin area.

      管理者

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。