Last updated on

When dealing with WordPress or BoldGrid PHP Issues, knowing how to change the PHP settings can be useful. In this guide, I will explain how to troubleshoot errors that are related to those settings, and the ways to make the changes needed to resolve these types of issues. The most common errors regarding PHP settings are related to Maximum Execution Time, Maximum Memory, Maximum Upload File size, and Maximum Input Vars.

 

MAX EXECUTION TIME

You may be seeing error messages that show “Maximum execution time of 30 seconds exceeded” or “Maximum execution time of 60 seconds exceeded”. This usually means that it is taking longer for a process to complete than your current PHP settings are allowing, and it is timing out because of it. This setting can be changed in either your .htaccess or php.ini file.

  1. .htaccess
    Add this value to .htaccess:
    php_value max_execution_time 60
  2. php.ini
    Add this value to php.ini:
    max_execution_time=60

If you are not sure how to make these types of changes, or if you are on type of hosting that prevents you from making them, then it is recommended that you contact your hosting provider and ask them to increase your maximum execution time.

 

MAX MEMORY

You may be seeing errors such as “Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes).” This can occur when the amount of memory that is allocated to PHP is being used before the script that is running can complete. Raising the amount of memory PHP will resolve these issues in most cases. This setting can be changed in either your .htaccess or php.ini file, but it can also be changed within your wp-config.php file as well. You want to check all 3 when troubleshooting these types of problems.

  1. .htaccess
    Add this value to .htaccess:
    php_value memory_limit 128M
  2. php.ini
    Add this value to php.ini:
    memory_limit=128M
  3. wp-config.php
    Add this value anywhere in your wp-config.php file, ensuring it is before the last line that includes the wp-settings.php file.
    define( 'WP_MEMORY_LIMIT', '128M' );

In some cases, your dashboard tasks may need more memory than the front end requires. When editing your wp-config.php, the memory allocated to the admin section can be raised by defining WP_MAX_MEMORY_LIMIT. Add this value anywhere in your wp-config.php file, ensuring it is before the last line that includes the wp-settings.php file.

  1. wp-config.php
    Add this value anywhere in your wp-config.php file, ensuring it is before the last line that includes the wp-settings.php file.
    define( 'WP_MAX_MEMORY_LIMIT', '256M' );

If you are not sure how to make these types of changes, or if you are using a hosting provider that prevents you from making them, then it is recommended that you contact your host and ask them to increase your maximum execution time on your behalf.

 

MAX UPLOAD SIZE

You may be seeing error messages when uploading images, or zip files for themes and plugins. This is usually directly related to the PHP settings for post_max_size, and upload_max_filesize. You can update these within your .htaccess or php.ini files. If using WordPress Multisite, you must also make a Network Admin Settings change as well

  1. .htaccess
    Add these values in your .htaccess file
    php_value post_max_size 64M
    php_value upload_max_filesize 64M
  2. php.ini
    Add or modify these values in your php.ini file
    post_max_size=64M
    upload_max_filesize=64M
  3. WordPress Multisite
    For Multisite, you must also set PHP upload limits within the Network Admin Dashboard, as it is defined there in Settings > Upload Settings

 

MAX INPUT VARS

When dealing with a translation plugin, or a large number of menu items, the max vars setting may need to be raised. In most cases, you will see an error when this limit is reached, but you can safely raise it if you are having related issues. To accomplish this, you can perform the following change in either your .htaccess or php.ini file:

  1. .htaccess
    Add this value in your .htaccess file
    php_value max_input_vars 10000
  2. php.ini
    Add or modify this value in your php.ini
    max_input_vars=10000

 

Congratulations! You now have the information needed to troubleshoot PHP Errors related to the PHP settings for BoldGrid and WordPress websites.

 

SIGNUP FOR

BOLDGRID CENTRAL  

   200+ Design Templates + 1 Kick-ass SuperTheme
   6 WordPress Plugins + 2 Essential Services

Everything you need to build and manage WordPress websites in one Central place.

2 thoughts on “How to Change PHP settings

  1. error:
    [Wed Apr 22 14:40:37.501631 2020] [fastcgi:error] [pid 2419250] [client (redacted):59322] FastCGI: server “/var/www/(redacted)/cgi-bin/php-fcgi-*-443-dpf-365.cz” stderr: PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 132136960 bytes) in /var/www/(redacted)/web/wp-content/plugins/boldgrid-backup/includes/class-boldgrid-backup-file.php on line 63PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 132116480 bytes) in /var/www/(redacted)/web/wp-includes/functions.php on line 4609, referer: https://(redacted)/wp-admin/admin.php?page=boldgrid-backup-archive-details&filename=boldgrid-backup-(redacted)-a2bfc8c7-20200422-120045.zip

    • Hello rs-
      This error message indicates your website is using over 268MB of memory while taking a backup. You can use the instructions in this article to increase your memory limit above that, however, that’s a lot more memory than you should need to use Total Upkeep. You may want to go ahead and post in our Support Forums to see if we can find out what’s using so much memory.

Leave a Reply

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