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

PowerShell: Optimize RAM on Remote Computers

# simultaneousExec_v0.01.ps1# Requirement: must run as Administrator$computerNames="SHERER1","SHERER2"function installEmptyStandbyList{ $emptyStandbyListAvailable=(Get-Command EmptyStandbyList.exe -ErrorAction SilentlyContinue); if(!($emptyStandbyListAvailable)){ # Set…

LAMPP Passwords Change

Change ProFTP password: vim /opt/lampp/etc/proftpd.conf <?-- delete the last line in password, leave the first…

How To Stop, Start, Restart a Windows Service Being Stuck in ‘Stopping’ Status

Convenient Function:(related to https://blog.kimconnect.com/powershell-kill-a-windows-service-forcefully) # forceRestartService.ps1 # version 0.0.2 $serviceName='Spooler' function forceRestartService($serviceName='Spooler'){ $processId=Get-WmiObject -Class Win32_Service…