• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Issue PHP file issue two memory limit scripts and how to increase WP memory limit.

TheBeatBali

Basic Pleskian
Server operating system version
Ubuntu 18.04.5 LTS
Plesk version and microupdate number
Plesk Obsidian v18.0.60_build1800240422.01 os_Ubuntu 18.04
This is the issue.
PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 163840 bytes)
I was told I have to increase the Wordpress memory limit.
I check the ‘WP_MEMORY_LIMIT’ on the wp-config.php and there appears to be two entries. Is that correct and which memory limit should I increase?
BTW I don't have wp-rocket installed.


full script

* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
// define( ‘WP_MEMORY_LIMIT’, ‘1024M’ );
define( ‘WP_MEMORY_LIMIT’, ini_get( ‘memory_limit’ ) );
$table_prefix = ‘un6G4_’;

define(‘WP_DEBUG’, false);
define(‘WP_DEBUG_LOG’, false);
define(‘WP_DEBUG_DISPLAY’, false);

define( ‘WP_MEMORY_LIMIT’, ‘512M’ );
define(‘WP_ALLOW_MULTISITE’, false);
// Added by WP Rocket
define( ‘DISALLOW_FILE_EDIT’, true );
/* That’s all, stop editing! Happy blogging. */

Where do I increase the memory limit? Thanks
 
You can increase by going to Domains > Domain in question > Dashboard > PHP, then you can edit the memory_limit from there.
 
So what about all this script in the wp-config.php? No problem?
If you look at the config file you'll see this
PHP:
define( ‘WP_MEMORY_LIMIT’, ini_get( ‘memory_limit’ ) );
That is referring to the PHP.INI file for getting the memory limit so you can ignore editing anything in the config file
BTw I just checked the dashboard PHP limit and it is already 512
Yes just adjust it to be like 1024m
 
If you look at the config file you'll see this
PHP:
define( ‘WP_MEMORY_LIMIT’, ini_get( ‘memory_limit’ ) );
That is referring to the PHP.INI file for getting the memory limit so you can ignore editing anything in the config file

Yes just adjust it to be like 1024m
Ok thank you. I have upped the limit. let's see if that helps.
 
Hi again. Maybe you could help explain why I am always receiving these error messages in the logs, if they are of any importance and what I can do to stop them appearing?

AH01071: Got error 'PHP message: PHP Warning: Constant WP_DEBUG_DISPLAY already defined in /var/www/vhosts/thebeatbali.com/httpdocs/wp-config.php on line 67; PHP message: PHP Warning: Constant WP_MEMORY_LIMIT already defined in /var/www/vhosts/thebeatbali.com/httpdocs/wp-config.php on line 69', referer: https://thebeatbali.com/superpwa-sw.js?2.2.31

Sorry, what do you think?
 
OK that error means you have define WP_MEMORY_LIMIT. Looking at your PHP code again that you've provided I do see it listed twice without the comments.

PHP:
// define( ‘WP_MEMORY_LIMIT’, ‘1024M’ );
define( ‘WP_MEMORY_LIMIT’, ini_get( ‘memory_limit’ ) );
$table_prefix = ‘un6G4_’;

define(‘WP_DEBUG’, false);
define(‘WP_DEBUG_LOG’, false);
define(‘WP_DEBUG_DISPLAY’, false);

define( ‘WP_MEMORY_LIMIT’, ‘512M’ ); <---- REMOVE THIS AS IT'S NOT NEEDED
define(‘WP_ALLOW_MULTISITE’, false);
// Added by WP Rocket
define( ‘DISALLOW_FILE_EDIT’, true );
/* That’s all, stop editing! Happy blogging. */
[CODE]
 
@TheBeatBali, the warning messages indicate duplicate entries. If you still have the following line in your wp-config.php file, please either comment it out or completely remove it:

define( ‘WP_MEMORY_LIMIT’, ‘512M’ );

and leave only:

define( ‘WP_MEMORY_LIMIT’, ini_get( ‘memory_limit’ ) );

Regarding WP_DEBUG_DISPLAY, please double-check if it is defined twice. If there's no duplicate entry under wp-config.php the constant might be present in another file.
 
@TheBeatBali, the warning messages indicate duplicate entries. If you still have the following line in your wp-config.php file, please either comment it out or completely remove it:



and leave only:



Regarding WP_DEBUG_DISPLAY, please double-check if it is defined twice. If there's no duplicate entry under wp-config.php the constant might be present in another file.
There are two entries. Do I delete the first entry on line 2 or the second entry on line 65? What do you think?

1. <?php

2. define('WP_DEBUG_DISPLAY', false);
define('CONCATENATE_SCRIPTS', false);
// Added by WP Rocket
define('WP_AUTO_UPDATE_CORE', 'minor');// This setting is required to make sure that WordPress updates can be properly managed in WordPress Toolkit. Remove this line if this WordPress website is not managed by WordPress Toolkit anymore.
/**

65. define('WP_DEBUG', false);
66. define('WP_DEBUG_LOG', false);
67. define('WP_DEBUG_DISPLAY', false);
 
It doesn't really matter which one you will remove as long as there are no duplicates. Maybe the one from the second line to keep it tidy since you have the rest of the debug values defined in lines 65-67.
 
It doesn't really matter which one you will remove as long as there are no duplicates. Maybe the one from the second line to keep it tidy since you have the rest of the debug values defined in lines 65-67.
Ok thanks Sebahat, that seem to have worked. No more error message.
However, there is a new one since updating elementor pro last night. Sorry if I am annoying.

31454#0: *2681198 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class "Elementor\Core\Schemes\Typography" not found in /var/www/vhosts/thebeatbali.com/httpdocs/wp-content/plugins/boosted-elements-progression/elements/advanced-button.php:168
Stack trace:
#0 /var/www/vhosts/thebeatbali.com/httpdocs/wp-content/plugins/elementor/includes/base/controls-stack.php(2386): Elementor\Widget_BoostedElementsAdvanced_Button->register_controls()
#1 /var/www/vhosts/thebeatbali.com/httpdocs/wp-content/plugins/elementor/includes/base/widget-base.php(1050): Elementor\Controls_Stack->init_controls()
#2 /var/www/vhosts/thebeatbali.com/httpdocs/wp-content/plugins/elementor/includes/base/controls-stack.php(569): Elementor\Widget_Base->init_controls()
#3 /var/www/vhosts/thebeatbali.com/httpdocs/wp-content/plugins/elementor/includes/base/widget-base.php(184): Elementor\Controls_Stack->get_stack()
#4 /var/www/vhosts/thebeatbali.com/httpdocs/wp-content/plugins/elementor/includes/managers/widgets.php(391): Elementor\Widget_Base->get_stack()
#5 [int" while reading response header from upstream

The symptom now is the elementor edit page doesn't open properly. A never ending spinning wheel. What do you think?
 
Back
Top