Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 13:00 9:00 – 13:00 9:00 – 13:00 8:00 – 12:00 8:00 – 12:00 -
- 14:00 – 17:00 14:00 – 18:00 14:00 – 18:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

Tagged: 

This topic contains 31 replies, has 2 voices.

Last updated by Bruno Kos 2 months, 2 weeks ago.

Assisted by: Bruno Kos.

Author Posts
October 21, 2024 at 11:07 am #16311864

kevinB-74

Here is the debug file :
hidden link

Can you make this conversation as private?

October 21, 2024 at 2:46 pm #16313083

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

All URLS in this thread are only visible to me and you.

As for error logs, I only see:

[21-Oct-2024 07:38:33 UTC] PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /home/ipkkcji/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php on line 50
[21-Oct-2024 07:38:33 UTC] PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line

But no call stack.

Can you try with this?

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable the display of errors and warnings on the frontend
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

// Ensure errors are logged
@ini_set( 'log_errors', 1 );

// Set a custom error log file
@ini_set( 'error_log', dirname(__FILE__) . 'https://cdn.wpml.org/wp-content/wp-errors.log' );

// Capture a detailed backtrace when a memory limit error occurs
function memory_exhaustion_handler() {
    $error = error_get_last();
    if ( $error && strpos( $error['message'], 'Allowed memory size' ) !== false ) {
        error_log( "Memory exhausted: " . print_r( $error, true ) );
        // Add a backtrace to the log to see what caused the error
        error_log( "Stack trace:" );
        error_log( print_r(debug_backtrace(), true) );
    }
}
register_shutdown_function('memory_exhaustion_handler');

These settings enable WordPress's debug mode and log the errors into a file (wp-content/debug.log). However, we're using a custom file for more control (wp-content/wp-errors.log).

The memory exhaustion-related errors, including the stack trace, will be logged in the file wp-content/wp-errors.log.

The backtrace will show you exactly what functions were called and which files and lines led to the memory being exhausted.

So:

- Add this to the wp-config.php file on the client’s server.
- Monitor the wp-errors.log file within the wp-content folder.
- Reproduce the error to capture the full stack trace.

The topic ‘[Closed] fatal error’ is closed to new replies.