Skip to main content

When reloading a page, you may encounter the following error:

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/content/core/lib/Drupal/Core/{some file .php} on line n

 

Solution

To resolve this issue, you need to adjust the max_execution_time parameter in the php.ini file.

Use the following command to locate your php.ini file:

php --ini

The response will be similar to

Configuration File (php.ini) Path: /usr/local/etc/php
Loaded Configuration File:         /usr/local/etc/php/php.ini

Open the php.ini file in a text editor. For example:

nano /usr/local/etc/php/php.ini

Find the max_execution_time setting. It may be set to 30 seconds by default

max_execution_time = 30

In my case this parameter wasn't set.  The parameter to change or add in the php.ini file is max_execution_time.

max_execution_time = 360

This sets the maximum execution time to 360 seconds.
Save the file and exit the text editor.
After modifying the php.ini file, restart Apache to apply the changes

service apache2 restart

 

Related articles

Andrew Fletcher11 Nov 2024
How to resolve the "filemtime(): stat failed" warning in Drupal 10 / 11
If you’re running a website on Drupal 10.x or 11.x, you might encounter a warning like this in your logs:> "Warning: filemtime(): stat failed for sites/default/files/php/twig/67312f8c6d7ee_paragraph.html.twig_oBJkUYn5Hj1Gltpsh3AXvAcSC/ErOs4_HSnzbWqmYFWDDuM3htp2ANqUUtX84lTbfu2Bg.php in...
Andrew Fletcher10 Sep 2024
Resolving PHP GD library issues in Drupal
IntroductionFor a while now, one persistent issue has been bugging me: a warning on Drupal's 'status report' page that reads:GD librarylibrary bundled (2.1.0 compatible)Supported image file formats: GIF, PNG.Unsupported image file formats: JPEG, WEBP.Check the PHP GD installation documentation if...