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

Sendmail Batch File

1. Download: 2. Place it in C:\Windows\System32   sendmail.bat --------------------------- senditquiet.exe -s smtp.gmail.com -port 587…

PowerShell: Install RSAT

What problem does this solve? dcdiag /test:dns dcdiag : The term 'dcdiag' is not recognized…

PowerShell: Remove an A-Host Record within Active Directory Integrated DNS Domain

Warning: this code is NOT 'production ready'. Please review and test on DEV environments carefully…