Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client encountered a PHP Fatal error indicating that the allowed memory size was exhausted while using the WPML plugin. This error was found in the PHP error logs and specifically occurred in the Macroable.php file.

Solution:
If you're experiencing this issue, it's likely related to your server or hosting settings. We recommend contacting your hosting provider to address this issue. Additionally, you can review similar cases and solutions by visiting the following custom search URL: related WPML forum tickets.
Please also ensure that your server meets our minimum requirements.

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Mihai Apetrei 4 months ago.

Assisted by: Mihai Apetrei.

Author Posts
August 7, 2024 at 11:04 pm #16049908

nasserA-3

<b>Background of the issue: </b>
I was routinely checking my PHP error logs, and I found the following errors.

[07-Aug-2024 03:58:20 UTC] PHP Fatal error: Allowed memory size of 5368709120 bytes exhausted (tried to allocate 262144 bytes) in /home/nuclearmed/htdocs/nuclearmed.org/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php on line 56

[07-Aug-2024 06:31:37 UTC] PHP Fatal error: Allowed memory size of 5368709120 bytes exhausted (tried to allocate 262144 bytes) in /home/nuclearmed/htdocs/nuclearmed.org/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php on line 56

This is Macroable.php from 40 to 60
/**
* Dynamically handle calls to the class.
*
* @param string $method
* @param mixed[] $parameters
* @return mixed
*
* @throws BadMethodCallException
*/
public static function __callStatic($method, $parameters)
{
if (! static::hasMacro($method)) {
throw new BadMethodCallException("Method {$method} does not exist.");
}

if (static::$macros[$method] instanceof Closure) {
return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters);
}

return call_user_func_array(static::$macros[$method], $parameters);
}

<b>Symptoms: </b>
PHP Fatal error: Allowed memory size of 5368709120 bytes exhausted!

<b>Questions: </b>
What caused the above errors?
How can I fix this issue?

August 8, 2024 at 8:56 pm #16054350

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi there.

Before this ticket gets assigned to one of my colleagues, I will try to help.

The "allowed memory exhausted" error is usually related to server/hosting settings so they (the hosting support) might be the only ones who can fix it.

However, there are a good amount of existing tickets related to this exact error with recommendations and solutions from our team.

I created this custom search URL below - can you please take a look at the tickets showing up and see if the solution that worked for the customers works for you, too?

Please let me know how that goes.

- hidden link

PS: Also, please make sure your server environment meets our minimum requirements as described here:
https://wpml.org/home/minimum-requirements/

There's a chance that they just happened in the background for a second if you did not see any issues on the front-end and in the functionality of the site.

Kind regards,
Mihai Apetrei