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
•
20 Feb 2025
Handling duplicate records in Drupal
Duplicate records in Drupal can cause significant issues, particularly when they lead to integrity constraint violations in the database. These errors often occur due to duplicate UUIDs in the `node` table, which can result from programmatic imports, migrations, or unintended database...
Andrew Fletcher
•
17 Feb 2025
The overlooked challenge of migration updates in Drupal projects
When working on Drupal migrations, developers often assume that adding a new field to the process section will seamlessly update existing content. However, unless explicitly handled, Drupal’s migration system does not automatically apply changes to previously migrated records. This oversight can...
Andrew Fletcher
•
11 Feb 2025
Webpack build process and theme automation improvements
The Drupal theme configuration has undergone recent changes made to the Webpack configuration, SCSS and JavaScript handling, and automation of updates to the orw.libraries.yml file in the custom Drupal theme. These changes are designed to improve the build process, enhance maintainability, and...