• I have recently upgraded my site to PHP 8.0.26 and now when I go to the Email log page I get an error “There has been a critical error on this website.”.

    The error log has this corresponding error:

    [06-Dec-2022...] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 81920 bytes) in /xxxx/public_html/staging/wp-includes/class-wp-object-cache.php on line 319

    PHP mem limit is set to 512M, the max on my hosting. If I switch back to PHP 7.4, I get no errors and can view the email log without issue.

    The email log contains 3,583 items.

    Any help greatly appreciated.

    Colin

    Diag Report:

    Mailer: postsmtp
    cURL Version: 7.71.0
    OpenSSL Version: OpenSSL/1.1.1p
    OS: Linux ams107.greengeeks.net 3.10.0-962.3.2.lve1.5.65.el7.x86_64 #1 SMP Wed Jan 19 09:35:41 UTC 2022 x86_64
    PHP: Linux 8.0.26 C
    PHP Dependencies: iconv=Yes, spl_autoload=Yes, openssl=Yes, sockets=Yes, allow_url_fopen=Yes, mcrypt=No, zlib_encode=Yes
    WordPress: 6.1.1 en_GB UTF-8
    WordPress Theme: BuddyBoss Child
    WordPress Plugins: Admin Menu Editor, Advanced Custom Fields, BuddyBoss Platform Pro, BuddyBoss Platform, Cookie Notice & Compliance for GDPR / CCPA, Default featured image, Disable Comments, Disable Bloat for WordPress & WooCommerce, Disable User Login, Disable WP REST API, Yoast Duplicate Post, Dynamic.ooo - Dynamic Content for Elementor, Ele Custom Skin, Elementor Pro, Elementor, Enable Media Replace, Flexible Elementor Panel, Glossary (Premium), Imsanity, Kadence WooCommerce Email Designer, Lazy Load Background Images for Elementor, LearnDash LMS - Elementor, LearnDash Licensing & Management, LearnDash LMS - WooCommerce Integration, Loginizer, Nav Menu Roles, OoohBoi Steroids for Elementor, Page scroll to id, Pods - Custom Content Types and Fields, Post SMTP, Redirection, Schema & Structured Data for WP & AMP, LearnDash LMS, SVG Support, UpdraftPlus - Backup/Restore, User Switching, WooCommerce Subscriptions, WooCommerce, Yoast SEO Premium, Yoast SEO, WP Crontrol, mb.miniAudioPlayer
    WordPress wp_mail Owner: /home/hostshaman/public_html/staging/wp-content/plugins/post-smtp/Postman/PostmanWpMailBinder.php
    WordPress wp_mail Filter(s): wp_staticize_emoji_for_email, PostsmtpMailer->get_mail_args
    WordPress phpmailer_init Action(s): WC_Email_New_Order->handle_multipart, WC_Email_Cancelled_Order->handle_multipart, WC_Email_Failed_Order->handle_multipart, WC_Email_Customer_On_Hold_Order->handle_multipart, WC_Email_Customer_Processing_Order->handle_multipart, WC_Email_Customer_Completed_Order->handle_multipart, WC_Email_Customer_Refunded_Order->handle_multipart, WC_Email_Customer_Invoice->handle_multipart, WC_Email_Customer_Note->handle_multipart, WC_Email_Customer_Reset_Password->handle_multipart, WC_Email_Customer_New_Account->handle_multipart, WCS_Email_New_Renewal_Order->handle_multipart, WCS_Email_New_Switch_Order->handle_multipart, WCS_Email_Processing_Renewal_Order->handle_multipart, WCS_Email_Completed_Renewal_Order->handle_multipart, WCS_Email_Customer_On_Hold_Renewal_Order->handle_multipart, WCS_Email_Completed_Switch_Order->handle_multipart, WCS_Email_Customer_Renewal_Invoice->handle_multipart, WCS_Email_Cancelled_Subscription->handle_multipart, WCS_Email_Expired_Subscription->handle_multipart, WCS_Email_On_Hold_Subscription->handle_multipart, WCS_Email_Customer_Payment_Retry->handle_multipart, WCS_Email_Payment_Retry->handle_multipart, PostsmtpMailer->phpmailer_smtp_init
    Postman: 2.1.10
    Postman Sender Domain (Envelope|Message): xxxxxxxx.co.uk | txxxxxxxx.co.uk
    Postman Prevent Message Sender Override (Email|Name): No | No
    Postman Active Transport: SMTP (smtp:tls:plain://mail.xxxxxxxx.co.uk:587)
    Postman Active Transport Status (Ready|Connected): Yes | Yes
    Postman Deliveries (Success|Fail): 3911 | 31
    Postman Email Log (Enabled|Limit|Transcript Size): Yes | 99 | 128
    Postman Run Mode: log_only
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter colinfroggatt

    (@colinfroggatt)

    Just deleted all email logs directly from database (on staging system) and I can now view the email log on PHP 8, so definitely related to number of logs in db. -C

    Plugin Support M Haseeb

    (@haseeb0001)

    @colinfroggatt Hi,

    I hope you are doing well.

    I think this is happening because of PHP memory settings.

    Fixing Error: There are a couple of ways to resolve this error. These include:

    1. Editing the wp-config.php file
    2. Editing the php.ini file
    3. Editing the .htaccess file

    1. Editing the wp-config.php file

    Here you will need to edit the wp-config.php file.
    define( ‘WP_MEMORY_LIMIT,’ ‘1024M’ );

    2. Editing the php.ini file

    On a live install, the file can be accessed within the root of your install, within the /public_html/ folder. Note that WordPress does not install the file but, in most cases, is set up by your host. For example, if you are using CPanel as your control panel, ensure the checkbox for “Show Hidden Files” is checked and then click Go. You may check into this article on how to edit the file. Before editing the file, kindly take a backup of it by downloading it to your computer.
    Once this is done, open the file, and add or edit the following line:

    memory_limit 512M

    3. Editing the .htaccess file

    The .htaccess file is a file located within the root of your WordPress files.

    You will need to add or edit the following code to the bottom of the file:

    php_value memory_limit 256M

    With this done, you can then save your changes and check if the error is resolved.

    You can read more about this here.

    Before doing anything, create a backup of your file or website.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Email log on PHP 8 causes PHP Fatal memory error’ is closed to new replies.