Posted On October 11, 2021

WordPress PHP Fatal error: Maximum execution time of 30 seconds exceeded

kimconnect 0 comments
blog.KimConnect.com >> Codes >> WordPress PHP Fatal error: Maximum execution time of 30 seconds exceeded
Error:
[Tue Oct 12 05:57:03.088314 2021] [php7:error] [pid 167] [client 172.16.90.64:39776] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /bitnami/wordpress/wp-content/plugins/nextgen-gallery/vendor/imagely/pope-framework/lib/class.extensibleobject.php on line 0, referer: 
Resolution:

Option A: Edit php.ini

// Case: Kubernetes Pod / Docker Container
containerName=sexcenter-wordpress-6f59c9fbff-5b99h
kubectl exec --stdin --tty $containerName -- /bin/bash

// Check execution time
grep max_execution_time /opt/bitnami/php/etc/php.ini

// Change execution time duration to 1 hour
sed -i '/max_execution_time/c\max_execution_time = 3600' /opt/bitnami/php/etc/php.ini

// Check memory limit
grep memory_limit /opt/bitnami/php/etc/php.ini

// Set memory limit to 20GB
sed -i '/memory_limit/c\memory_limit = 20G' /opt/bitnami/php/etc/php.ini

// Change execution time duration and memory to unlimited (for testing purposes)
sed -i '/max_execution_time/c\max_execution_time = 999999' /opt/bitnami/php/etc/php.ini
sed -i '/memory_limit/c\memory_limit = -1' /opt/bitnami/php/etc/php.ini

// Restart apache
apachectl restart

Option B: Edit wp-config.php

// Set execution time to 24 hours
ini_set('max_execution_time', '5184000');
set_time_limit(5184000);

Option C: Edit .htaccess

php_value max_execution_time 120

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Repair Windows Server 2016 Error 0x800f081f

Run this function in PowerShell as Administrator: function resetWindowsUpdate{ # Source: https://learn.microsoft.com/en-us/troubleshoot/windows-client/installing-updates-features-roles/additional-resources-for-windows-update write-host 'Resetting Windows…

PowerShell: How to Play a Sound

$soundFile="C:\Windows\media\tada.wav"$sound = new-Object System.Media.SoundPlayer$sound.SoundLocation=$soundFile$sound.Play()

PowerShell: Remove Nic Teaming

# Check NIC TeamingPS C:\Windows\system32> get-NetLbfoTeamName : ISCSIMembers : {iSCSI-B, iSCSI-A}TeamNics : ISCSITeamingMode : SwitchIndependentLoadBalancingAlgorithm…