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の最大実行時間が超過しました。

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

致命的なエラー:WordPressのプラグインやテーマを更新しようとすると、画面に「Fatal error: Maximum execution time of 30 seconds exceeded」と表示されていませんか?

通常、この問題はWordPressのPHPスクリプトの実行に時間がかかり、WordPressホスティングサーバーが設定した最大制限時間に達した場合に発生します。時間制限は、サーバーリソースの乱用を防ぐために重要です。

この投稿では、WordPressの致命的なエラー「最大実行時間を超えました」を修正する方法を紹介します。

Fix Fatal Error: Maximum Execution Time Exceeded in WordPress Easily

最大実行時間超過エラーはなぜ起こるのか?

WordPressで最大実行時間超過エラーが発生するのは、WordPressを支えるプログラミング言語であるPHPが、スクリプトの実行時間に制限を設けているためです。この制限は、ウェブサーバーが悪用されるのを防ぐために設けられています。

ホスティングサービス会社によって様々な制限時間が設定されていますが、30~60秒で十分な場合が多いです。WordPressサイトのPHPスクリプトにこの設定時間を超える時間がかかると、最大実行時間を超過したエラーが発生します。

Maximum Execution Time of 30 Seconds Exceeded Error in WordPress

WordPressの最大実行時間超過エラーを修正する方法

最大実行時間超過エラーは「致命的なエラー」と呼ばれていますが、実際には簡単に修正できるWordPressの最も一般的なエラーの1つです。

WordPressの最大実行時間を超えましたエラーを修正する方法を見てみましょう。以下のリンクから、さまざまなトラブルシューティングに飛ぶことができます:

重要: サイトのエラー発生を防ぐため、WordPressのバックアップをお勧めします。詳しくはWordPressサイトのバックアップ方法をご覧ください。

方法1:WordPressリカバリーモードを使う

いつ、どこでエラーが発生したかによって、WordPressはフロントエンドに「このサイトは技術的な問題が発生しています」というエラー通知を表示することがあります。

Technical difficulties

これはWordPress 5.2で追加された致命的エラー保護機能の一部です。

また、どのプラグイン(プラグインがエラーを引き起こした場合)が問題の原因となったかをお知らせするメールを受け取ることもあります。

Technical issue email sent to admin

メールには特別なリンクも掲載される。

これで「リカバリーモード」を使ってWordPressにログインできるようになる。

Recovery mode

そこで、エラーの原因となっているプラグインを無効化または削除すればよい。

詳しくは、WordPressリカバリーモードの使い方WordPressプラグインの無効化方法をご覧ください。

方法2:.htaccessファイルを編集する

この方法は、WordPressダッシュボードにアクセスできないWordPressユーザーにお勧めします。最大実行時間制限エラーを修正するには、.htaccessファイルを手動で編集し、簡単なコード行を追加する必要があります。

FTPクライアント、またはcPanelや他のウェブホスティングダッシュボードのファイルマネージャーアプリを使用してサイトに接続するだけです。

.htaccessファイルは、/wp-content/および/wp-admin/フォルダと同じフォルダにあります。.htaccessファイルが見つからない場合は、.htaccessファイルが見つからない理由と見つける方法の投稿をご覧ください。

例えば、FTPクライアントとしてFileZillaを使用している場合、右側の列の「リモートサイト」セクションにあります。

WordPress .htaccess File in Filezilla

.htaccessファイルを見つけたら、右クリックして「表示/編集」オプションを選択するだけです。

テキストエディターでファイルを開きます。

View/Edit .htaccess File in WordPress

次に、.htaccessファイルの一番下に以下のコードを追加する必要がある:

php_value max_execution_time 300

テキストエディターとしてメモ帳を使っている場合は、以下のようになります。

それが終わったら、ファイルを保存する。

Adding Code to .htaccess File WordPress

このコードでは、最大実行時間の値を300秒(5分)に設定するだけです。これで、サイトにアクセスしてエラーメッセージが消えているかどうかを確認できる。

それでもエラーが出る場合は、値を600に増やしてみてください。

この方法が役に立ったなら、WordPressで最も便利な.htaccessのトリックをご覧ください。

方法3:php.iniファイルを修正する

WordPressの最大実行時間超過エラーを修正するもう一つの方法は、php.iniファイルを修正することです。

php.iniファイルは、サーバー上のPHPの設定を定義する設定ファイルです。多くのWordPressホスティングプラットフォームでは、ルートフォルダー内に表示されない場合があります。

その場合、FTPまたはファイルマネージャーアプリを使用して、WordPressのルートフォルダー内に新規php.iniファイルを作成することができます。

その後、php.iniファイルを編集し、以下の行を追加するだけです:

max_execution_time = 60

ファイルを保存し、サーバーに変更をアップロードすることを忘れないでください。これでサイトにアクセスして、エラーが消えたかどうかを確認することができます。

方法4:wp-config.phpファイルを編集する

この方法は、.htaccessファイルの編集とは若干異なります。どちらもサイトの最大実行時間を増加させますが、wp-config.phpを編集するとサーバー全体に影響する設定が作成されます。

以前と同様に、FTPクライアントまたはウェブホスティングコントロールパネルのファイルマネージャを使用してWordPressのルートディレクトリにアクセスする必要があります。そして、wp-config.phpファイルを見つけ、編集するために開きます。

という行の直前に以下の行をペーストしてください。 以上で編集は終了です!ハッピー・ブログ

define('WP_MAX_EXECUTION_TIME', 300); // Replace 300 with your desired time in seconds

このコード・スニペットは、WordPressサイト専用のカスタマイザー最大実行時間を定義します。秒数を増やす前に、エラーが修正されるかどうかを確認するために300から始めることをお勧めします。

方法5:WordPressデータベースを最適化する

肥大化したデータベースは、サイトの速度を低下させ、最大実行時間を超過したエラーにつながる可能性があります。定期的にデータベースを最適化することで、不要なデータが削除され、WordPress全体のパフォーマンスが向上します。

ありがたいことに、データベースの最適化はもうそれほど技術的なことではありません。WordPressのデータベースをワンクリックで最適化する方法については、こちらのガイドをご覧ください。

方法6:WordPressのプラグインをチェックする

プラグインは諸刃の剣です。プラグインは機能を追加する一方で、お粗末にコーディングされたプラグインは過剰なリソースを消費し、実行のタイムアウトにつながることもある。

問題のあるプラグインを特定するには、すべてのプラグインを一時的に無効化し、エラーが消えるかどうかを確認します。エラーが消えた場合は、プラグインが原因である可能性が高いです。

Bulk deactivate all WordPress plugins

プラグインを1つずつ有効化し、有効化するたびにエラーをチェックする。これにより、問題を引き起こしている特定のプラグインを特定することができます。

管理エリアにアクセスできない場合は、wp-adminダッシュボードにアクセスできなくてもプラグインを無効化するガイドがあります。

問題のあるプラグインを特定したら、プラグイン作者にサポートを求めましょう。さらに、WordPress.orgやWPBeginner Solution Centerのような信頼できるプラグイン・リポジトリーを利用して、よく評価され、ニーズに最適化されたプラグインを見つけることも検討しましょう。

WPBeginner's WordPress Solution Center

ほとんどの場合、これらの方法で最大実行時間を増やすとエラーは解決します。しかし、それでも解決しない場合は、WordPressホスティングサービスに問い合わせる必要があります。

WordPress サイトのサポートについては、WordPress サポートの正しい依頼方法をご覧ください。

さらに詳しくWordPressのよくあるエラーを解決する方法

その他のWordPressエラーにお困りですか?これらのガイドがお役に立てるかもしれません:

この投稿がWordPressの致命的なエラー:最大実行時間を超えましたを修正するのにお役に立てば幸いです。また、WordPress でデータベース接続を確立するエラーを修正する方法と最高のマネージド 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

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

  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. Jiří Vaněk says

    What do you think is a reasonable maximum of this value? Sometimes some plugins, especially for import and export, need quite a lot of time before performing an action. So I would be interested in what value it is no longer good to get over, because it could mean, for example, a security risk.

    • WPBeginner Support says

      Starting with 60 is normally a good way to test and then it would depend on the specific task for how much to increase it or if the host needs to be checked with for an error.

      管理者

      • Jiří Vaněk says

        Thank you for answer. I currently have a limit of 300 and then that’s enough. So I’ll leave it at this value then we’ll see. When I put it lower, I sometimes don’t fit into the limits. Thank you. I will definitely not increase the limit then.

  3. mudasir abbas turi says

    when ever i have face with problem then i search on google i found your website and i have always solve my problem from your website thanks too much

    • WPBeginner Support says

      You would use the same method, you may want to ensure the file isn’t already created under xampp/php in which case you would want to edit the file there.

      管理者

  4. Umesh Vinayak Shejole says

    It’s working properly. I am installed premium shopping theme & got error when installing required plugins. After putting php_value max_execution_time 300 line in my .htaccess file it’s working & being installed all required plugin. I am trying from last 2 / 3hrs with this problem. Thank you for saving lot’s of time.

  5. Lyubomir says

    Thanks a lot for the great article !
    It resolved my issue – it happened on trying to upgrade my localhost WordPress installation from v.5.2.5 to v.5.3.2
    Adding the line “php_value max_execution_time 300” at the bottom of the .htaccess file proved to be enough, in my case.
    Best regards !

  6. Al-Amin Khan says

    I was very upset for this problem. After reading your article this problem has solved.
    Thank you so much.

  7. Amelia John says

    Hey Dears,
    I am getting a maximum execution time limit error like below when clicking on the woocommerce settings tab. I added max_execution_time = 360 to php.ini file however it’s not working as well.

    Deactivated every plugin by keeping woo-commerce only also changed to a default WordPress theme, none of these steps work for me.

    Any good hearts here to help me to sort out this issue?

    • WPBeginner Support says

      Reach out to your hosting provider to see if they have an overriding setting preventing you from changing the execution time for your site. That could be the likely reason

      管理者

    • Kaan Oezgiray says

      Try this in your script (I placed it on the first line and it works):
      ini_set(‘max_execution_time’, ‘600’);

      Hope it helps.

      -Kaan

  8. mubarak hassan says

    How can I solve this? Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\wp\wp-includes\Requests\Transport\cURL.php on line 163

  9. MU says

    down vote
    You have to just check whether your WAMP server is online or not.

    To put your WAMP server online, follow these steps.

    Go to your WAMP server notification icon (in the task bar).
    Single click on the WAMP server icon.
    Select last option from the menu, that is, Put Online
    Your server will restart automatically (in the latest versions only). Otherwise, you have to restart your server manually.
    And you are DONE…

  10. Waqas says

    Hi, I have been facing this issue for along time don’t know how to solve it.

    I am getting this error while visiting my homepage Warning: session_start(): open(/tmp/sess_e8717886215bae41c9c82993bd822901, O_RDWR) failed: Disk quota exceeded (122) in /home/waqas1385/public_html/example.com/wp-content/plugins/easy-contact/econtact.php on line 112

    I have searched my whole site but I don’t have this plugin ‘easy contact’ installed and I can’t find it in the file manager.

    please help me how to fix this error. Thanks

    • WPBeginner Support says

      Hi Waqas,

      Try using an FTP client and locate this folder manually. Make sure that your FTP client is set to show hidden files too.

      It seems that some poorly coded plugin is starting sessions and your server is unable to delete temporary session files. It could also be caused by a temporary files stored elsewhere like your web hosting mailboxes.

      管理者

  11. Jess says

    This didn’t work for me, now I can’t even get to the log in page and it gives an error message for my whole site :(

  12. Ahmad says

    Hi I am using php 5.5
    When i open .htaccess code editor in cpanel i see the following text
    where should i exactly add this code and save it?

    # Use PHP55
    AddHandler application/x-httpd-php55 .php

    suPHP_ConfigPath /opt/php55/lib

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  13. Ellayararwhy says

    This doesn’t fix the underlying problem at all, which is that something running under WP is totally consuming CPU resources. To suggest that just increasing the timeout value is a fix is not good practice – focus on the root cause.This can happen in many ways (apache library, synchronous read, etc), but the usual culprits are some PHP code in some WP plug-in stuck in a very long or infinite iteration loop. Perhaps there is a weird interaction between two or more WP plugins.

    In all scenarios, including ones not discussed, is that you have to back off (disable) your WP plugins until the CPU load decreases to a reasonable value. The next step is to figure out how to track down a plugin problem or plugin interaction issue, which may involve quality time on forums focused on the suspect plugins.

    • Leo says

      I agree with @ELLAYARARWHY. The point of setting max execution time is for security and the users experience, changing the settings this way to me is only putting a patch on the issue rather then actually fixing it. Increasing the time is not a long term solution.

  14. ZS says

    I have WordPress 4.1 installed on XAMPP. I didn’t have any .htaccess files in the wp-content and wp-admin folders. I added them myself with the code you mentioned but that didn’t fix the error. I’ve also tried installing the plugin and that also did not fix the error.

    I tried running WordPress on WAMP and I am getting the error on WAMP too. I am getting this error when I try to import the Theme Unit Test XML file. What else can I do? :(

返信を残す

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