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
•
27 Apr 2024
Streamlined Drupal 10 Deployment: Best Practices for Stability and Security
Have you ever walked into a situation at work and just wondered how everything still runs smoothly? I mean, there are deployments with so many fail-safes stacked on a shaky foundation that it's almost a miracle they work at all. The real trick is gently nudging the team toward accepting change to...
Andrew Fletcher
•
27 Apr 2024
TypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string
I'm getting the following errorTypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string in Drupal\views\Plugin\views\argument\ArgumentPluginBase->unpackArgumentValue() (line 1302 of...
Andrew Fletcher
•
21 Apr 2024
This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size...