Andrew Fletcher published: 22 November 2023 1 minute read
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 Fletcher
•
31 May 2024
Connecting AWS S3 with Docker for Drupal 10
Recently, I encountered an issue where my local Docker environment refused to connect to AWS S3, although everything worked seamlessly in AWS-managed environments. This challenge was not just a technical hurdle; it was a crucial bottleneck that needed resolution to ensure smooth Drupal deployments...
Andrew Fletcher
•
09 May 2024
Accessing nested paragraph fields in Drupal: a step-by-step reference
The issue – I have a content type that includes an entity reference revisions field named field_introduction. This field points to a paragraph, which itself contains a text field also named field_introduction, of the type Text (formatted, long). How can I access the content stored in this...
Andrew Fletcher
•
09 May 2024
How to retrieve the current menu title in Drupal – a developer’s reference
When building a theme in Drupal, it's often necessary to adapt your site’s UI dynamically based on the context in which a user is navigating. One such piece of dynamic content is the menu title. Achieving this can be a bit tricky due to the layered nature of its routing and menu systems. This...