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. 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.

      管理者

  3. Adriana says

    Hello,
    I have tried all of them steps, and none has worked, I am not sure what else to do at this point , as i’m on limited time and would need this fixed , if any other ideas please do help. Thank you so much

    • WPBeginner Support says

      You may want to reach out to your hosting provider to see if they see any errors on their end that could be causing the issue.

      管理者

  4. Tina says

    Hi,

    thanks for this guide. Unfortunately, all these ideas did not work for me. Today, in an attempt to remove the “website is on partially safe” SSL certificate message, I used “Search and Replace” plugin to search my databases for “http” and changed those to “https”. That’s the only thing I could relate to this error, but since I am no expert on this, I don’t know how and if I can fix this or how I can undo these changes. Any help?

  5. kyle says

    Hi i get the http error everytime i upload an image over 4mbs. I have contacted my web designer and host and they have both tried to load images over 15mbs and it is working for them. However, i have tried mulitple computers on different internet connections and i still get the http error. Can u please help?

  6. Hien says

    I just wanted to comment, #3 definitely helped with 503 error/http error when uploading pictures sometime. Other time, upload pictures fine.

    • WPBeginner Support says

      You would normally want to put added code at the end in case you need to edit or remove the code later

      管理者

  7. Mike Gaudreau says

    In my case, I simply logged out of the dashboard and right back in and the problem was cleared.

    • WPBeginner Support says

      Thanks for sharing that, it sounds like either your caching had a hiccup or you ran into one of the server issues :)

      管理者

  8. Mohamed says

    You can’t imagine the level stress of this HTTP thing has created on me. Number 3 is my lifesaver. Thank you for posting this.

  9. Janet says

    I had about 10 pictures to upload and repeatedly got the HTTP error for 3 of them. I finally sussed that those three had an apostrophe in the file name!!! Doh! Removing the apostrophe was the solution.

    • WPBeginner Support says

      Thanks for sharing your solution, glad you were able to get the files uploaded :)

      管理者

  10. Alissa says

    Before I tried any of these solutions. I tried logging out of WordPress and logging back in, and suddenly I stopped getting the error message. So, you might want to try that first.

  11. Isla S says

    I’ve noticed that this keeps happening to me with files that contain apostrophes in the filename. When I remove it, they upload fine

    Perhaps try to remove the ‘ ?

  12. Christina says

    None of these worked for me. After some more researching, I found that putting this bit of code at the bottom of the .htaccess worked for me:

    # Exclude the file upload and WP CRON scripts from authentication

    Satisfy Any
    Order allow,deny
    Allow from all
    Deny from none

    Don’t forget to back up your .htaccess file first just in case!

    • WPBeginner Support says

      These methods should work with localhost, the memory limit may need to be modified using the program for your server such as MAMP or WAMP

      管理者

  13. Omar Ajruli says

    Option number three fixed my problem guys, thank you. Have a great day.
    3. Change Image Editor Library Used by WordPress.

  14. Emmanuel Usen Jackson says

    My blog shows me “An error occurred in the upload. Please try again later.”. Please what should I do?

  15. vishwas says

    i did all the above changes in my site still image is not uploading, please help me to resolve this issue (http error)

  16. David says

    For me, the issue was a series of pictures with an apostrophe in the title. Renamed and it worked fine.

  17. Tom Jaggard says

    I need help resolving the HTTP error when uploading large files. Someone else created my site with an upload size limit of 64Mb. I am trying to upload audio files that are sometimes larger than 64Mb. I added a plug-in (Upload Max File Size) to change my max upload size to 128Mb. I changed memory_limit in PHP.ini to 256M. I change max_execution_time in PHP.ini to 300. I set memory_limit in wp-config to 256M. I changed memory_limit in .htaccess to 256M. I tried adding the code to .htaccess to force it to use the GD Library instead of Imagick. It didn’t work, so I remove that code and then added the line to limit Imagick to 1 thread. In spite of all of these changes, I still get the HTTP error when loading a file larger than 64Mb.
    Any more ideas?
    Thanks!

  18. siddharth pathak says

    thanks a lot, I was trying to fix this from last 2 hour and after reading this article did it in just few sec and already tested thanks a lot

  19. Mauricio Lazo says

    As a side note, another thing that can be giving you HTTP errors while uploading images is a configuration in you php.ini file, specifically the line “max_execution_time=30;”.

    Some shared hosting providers limit PHP execution to a single core of the server, increasing the time it takes for PHP Imagick to get the image, process it and create thumbnails. So the suggestion is to increase max_execution_time to 120 seconds instead of the default 30 seconds.

  20. wassim jied says

    Hello
    In my case

    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’ );

    worked fine thanks

    Php Memory limit 128Mo v 7.13 apache 2.4

  21. Joost Walter says

    One of the causes of an upload error is the fact that there is an apostrophe in the name of the file that you try to upload. For instance a picture called ‘Let’s_dance.jpg’ will give an error, while ‘Lets_dance.jpg’ can be uploaded without any problems.

返信を残す

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