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

Hur man Fixar Fatal Error: Maximal exekveringstid överskriden i WordPress

Ser du ”Fatal error: Maximum execution time of 30 seconds exceeded” på din vy när du försöker update ett plugin eller theme till WordPress?

Vanligtvis uppstod detta problem när ett PHP-skript i WordPress tar lång tid att runna och når den maximala tidsgränsen som ställts in av din server på WordPress webbhotell. Tidsgränsen är viktig eftersom den förhindrar missbruk av serverns resurser.

I den här artikeln kommer vi att visa dig hur du fixar det fatala error: maximal exekveringstid överskriden i WordPress.

Fix Fatal Error: Maximum Execution Time Exceeded in WordPress Easily

Varför inträffar error ”Maximum Execution Time Exceeded”?

Felet maximal exekveringstid överskriden inträffar i WordPress eftersom PHP, programmeringsspråket bakom WordPress, har en limit för hur länge ett skript kan runna. Denna limit finns för att förhindra att web servers missbrukas.

Olika webbhotell ställer in olika tidsgränser, men 30-60 sekunder är ofta tillräckligt. Om ett PHP-skript på din WordPress site tar längre tid än den inställda tiden, utlöser det error om att den maximala exekveringstiden överskridits.

Maximum Execution Time of 30 Seconds Exceeded Error in WordPress

Så här fixar du erroret Maximal exekveringstid överskriden i WordPress

Även om felet för överskriden maximal exekveringstid anropas som ett ”fatal error”, är det faktiskt ett av de vanligaste WordPress-felen som är lätta att fixa.

Låt oss klura på hur du fixar erroret Maximal exekveringstid överskriden i WordPress. Du kan använda länkarna under för att hoppa till de olika metoderna för troubleshoot:

Viktigt: Vi rekommenderar att du säkerhetskopierar din WordPress för att förhindra att ytterligare error uppstod på din website. Vänligen läs vår guide om hur du säkerhetskopierar en WordPress website för mer information.

Metod 1: Använd WordPress återställningsläge

Beroende på när och var error utlöses kan WordPress visa felmeddelandet ”This site is experiencing technical difficulties” on the front end.

Technical difficulties

Detta är en del av funktionen för skydd mot fatal errors som utvaldes i WordPress 5.2.

Du kan också få ett email som talar om för dig vilket plugin (om ett plugin utlöste error) som orsakade issue.

Technical issue email sent to admin

Emailen kommer också att innehålla en speciell link.

This will allow you to logging in to WordPress using ”Recovery mode”.

Recovery mode

När du väl är där kan du helt enkelt deactivera eller ta bort det plugin som orsakar error.

För mer detaljer, vänligen se vår guide om hur du använder WordPress återställningsläge och hur du deaktiverar WordPress tillägg.

Metod 2: Edit Your .htaccess-fil

Den här metoden rekommenderas för WordPress-användare som inte kan komma åt sin WordPress dashboard. För att fixa maximum execution time limit error måste du manuellt editera din .htaccess-fil och add to en enkel kodrad.

Anslut bara till din website med en FTP-klient eller appen File Manager i din cPanel eller annan dashpanel för webbhotell.

Din .htaccess-fil ligger i samma folder som dina /wp-content/ och /wp-admin/ folders. Om du inte kan hitta den, se vår artikel om varför du inte kan hitta .htaccess-filen och hur du hittar den.

Om du t.ex. använder FileZilla som FTP-klient hittar du den i sectionen ”Remote Site” i den högra colonnen.

WordPress .htaccess File in Filezilla

När du har hittat .htaccess-filen högerklickar du på den och väljer alternativet ”View/Edit”.

Detta öppnar filen i en textredigerare.

View/Edit .htaccess File in WordPress

Följaktligen måste du add to följande kod längst ner i din .htaccess-fil:

php_value max_execution_time 300

Om du använder Notepad som textredigerare kan det se ut så här.

När det är gjort går du vidare och save filen.

Adding Code to .htaccess File WordPress

Den här koden ställer helt enkelt in värdet för maximal exekveringstid till 300 sekunder (5 minuter). You can now visit your website to see if the error message is gone.

Om du fortfarande får error, försök då att öka värdet till 600.

Om du tyckte att den här metoden var till hjälp kan du kontrollera de mest användbara .htaccess-tricken för WordPress.

Metod 3: Ändra php.ini-filen

En annan metod för att fixa maximum execution time exceeded error i WordPress är att ändra din php.ini-fil.

php.ini-filen är en konfigurationsfil som definierar inställningarna för PHP på din server. På många WordPress webbhotell kanske du inte ser den i din root folder.

I så fall kan du skapa en new php.ini-fil i din WordPress root folder med hjälp av FTP eller File Manager appen.

Följ detta genom att helt enkelt edit filen php.ini och add to följande rad:

max_execution_time = 60

Glöm inte att save filen och uploada dina ändringar tillbaka till servern. You can now visit your website and to see if the error has gone.

Metod 4: Edit Your wp-config.php-fil

Den här metoden skiljer sig något från att editera .htaccess-filen. Båda ökar den maximala körtiden för din website, men när du editerar wp-config.php skapas en inställning som påverkar hela din server.

Gilla tidigare, du bör komma åt din WordPress root directory med hjälp av en FTP-klient eller din webbhotell kontrollpanels filhanterare. Sedan lokaliserar du filen wp-config.php och öppnar den för edit.

Klistra in följande rad precis före raden där det står That's all, stop editing! Trevlig blogg..:

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

Detta code snippet definierar en custom maximal exekveringstid specifikt för din WordPress site. Vi rekommenderar att du börjar med 300 för att se om det fixar error innan du lägger till fler sekunder.

Metod 5: Optimera din WordPress Database

En uppsvälld database kan ibland sakta ner din website, vilket kan leda till error ”maximum execution time exceeded”. Regelbunden optimering av din database tar bort onödiga data och förbättrar din totala WordPress-prestanda.

Tack och lov är det inte så tekniskt längre att optimera en database. Du kan läsa vår guide om hur du optimerar din WordPress Database med ett klick för steg-för-steg-instruktioner.

Metod 6: Kontrollera dina tillägg till WordPress

Tillägg kan vara ett tveeggat svärd. Samtidigt som de addar funktionalitet kan vissa dåligt kodade tillägg förbruka stora resurser, vilket leder till tidsavbrott i exekveringen.

För att identifiera ett problematiskt plugin kan du tillfälligt deactivate alla dina tillägg och se om error försvinner. Om det gör det är det troligtvis ett tillägg som är boven i dramat.

Bulk deactivate all WordPress plugins

Nu reaktiverar du tilläggen ett i taget och kontrollerar om error uppstår efter varje reaktivering. Detta hjälper till att lokalisera det specifika tillägg som orsakar issue.

Om du inte kan komma åt admin area har vi en guide om hur du deaktiverar tillägg även när du inte kan komma åt wp-admin dashboard.

När du har identifierat det problematiska pluginet, kontakta plugin-författaren för support. Dessutom kan du överväga att använda betrodda plugin repository gillar WordPress.org och WPBeginner Solution Center för att hitta väl reviewerade och optimerade tillägg för dina behov.

WPBeginner's WordPress Solution Center

I de flesta fall kommer error att lösas genom att öka den maximala exekveringstiden med hjälp av dessa metoder. Men om det inte gör det måste du kontakta din WordPress hosting provider för att få hjälp.

För mer information om hur du får hjälp med din WordPress site, läs vår guide om hur du ber om support för WordPress på rätt sätt.

Learn More sätt att lösa vanliga error i WordPress

Upplever du andra typer av error i WordPress? Dessa guider kanske kan hjälpa dig:

Vi hoppas att den här artikeln hjälpte dig att fixa det fatal error: maximum execution time exceeded i WordPress. Du kanske också vill se vår guide om hur du fixar error establishing a database connection i WordPress och våra toppval för de bästa hanterade hosting providers för 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.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

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.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

71 kommentarerLämna ett svar

  1. Syed Balkhi

    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

    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

      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.

      Administratör

      • Jiří Vaněk

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

    Thanks! it solved my issue.

    • WPBeginner Support

      Glad our article could help!

      Administratör

  4. Ricky

    thank you so much bro!

    • WPBeginner Support

      You’re welcome!

      Administratör

  5. Assadullah Shaikh

    That really helped, thanks mate!

    • WPBeginner Support

      Glad our guide was helpful!

      Administratör

  6. faisalnawaz

    You are great, issue resolved. keep it up. once again Thank you.

    • WPBeginner Support

      Glad our guide was helpful :)

      Administratör

  7. mudasir abbas turi

    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

      Glad our guides have been helpful :)

      Administratör

  8. nikos3194

    Thanks so much for the help!

    • WPBeginner Support

      You’re welcome :)

      Administratör

  9. pradip

    Thanks for this great article. My problem is solved :)

    • WPBeginner Support

      Glad our guide was able to help you :)

      Administratör

  10. Ranjeet Gaur

    How to solve this issue on local hosted Wordpress on XAMPP

    • WPBeginner Support

      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.

      Administratör

  11. Muhammad Hassan Kareem

    Great,it’s work for me

    • WPBeginner Support

      Glad our guide was helpful :)

      Administratör

  12. Tanbir

    not solving by this instruction..what i do now

    • WPBeginner Support

      Reach out to your hosting provider and they should be able to assist

      Administratör

  13. Umesh Vinayak Shejole

    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.

    • WPBeginner Support

      Glad our guide was helpful :)

      Administratör

  14. MITESH

    have just paste a code in bottom and its all done

    • WPBeginner Support

      Glad our recommendation was helpful :)

      Administratör

  15. Lyubomir

    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 !

    • WPBeginner Support

      You’re welcome, glad our guide was able to help :)

      Administratör

  16. Al-Amin Khan

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

    • WPBeginner Support

      Glad our guide could help :)

      Administratör

  17. Shubham Vats

    Thank You so much brother

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Administratör

  18. Quy

    Hi there,
    thanks for posting this very useful info.
    It helps me a lot.
    Wishing you all the best,
    Quy

    • WPBeginner Support

      Glad our guide could be helpful :)

      Administratör

  19. Karina

    I followed the steps but It didn’t work, shows 500 internal error message and site went down.

  20. Amelia John

    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

      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

      Administratör

    • Kaan Oezgiray

      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

  21. mubarak hassan

    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

    • WPBeginner Support

      Hey Mubarak,

      Please follow the instructions in the article above. Let us know if they don’t work out for you.

      Administratör

  22. Aman Gupta

    My WordPress site loads after showing an error for 2 seconds ..

  23. Jeppe Bech

    Neither of the solutions worked for me.

  24. Prof C M Sharma

    Thanks for the simple yet working solution!

  25. Shahrukh

    The plugin works very well for me. Thanks a lot :)

  26. mohammad

    Thank you. Problem solved..

  27. MU

    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…

  28. sina

    Tanks . There problem solved

  29. Waqas

    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

    • Waqas

      I am placing this comment to subscribe to my previous comment.

    • WPBeginner Support

      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.

      Administratör

  30. Jess

    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 :(

  31. Ahmad

    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

    • Ahmad

      It doesn’t work shows 500 internal error message and site went down.

  32. srinivas

    php_value max_execution_time 300
    php_value max_input_time 300

  33. syed shahid

    Thank you Sir

    Helpful article I solve my problem

  34. Tehseen

    I am getting this error on local host. will this method solve my problem?

    • Zied

      yes, this will fix it

  35. Ellayararwhy

    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

      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.

  36. Andrea Moor

    Thank you for the help!

  37. SHABBIR

    Thanks for this great article.

  38. Mohsin

    Thanks for great article

  39. ZS

    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? :(

  40. Keith Davis

    Hi Syed
    I’ve had that error message a few times when updating WordPress local sites using XAMPP.

    Would this solution work on a local install.

    • Atwine

      Superb it works just fine, on a local install as well

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.