• When I try to enable PHP 7.3 for my site, there is a fatal error:

    [23-Sep-2019 18:41:54 UTC] PHP Fatal error: Uncaught Error: Undefined class constant ‘MYSQL_ATTR_INIT_COMMAND’ in /home/myusername/public_html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php:68
    Stack trace:
    #0 /home/myusername/public_html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php(36): MailPoet\Doctrine\ConnectionFactory->getDriverOptions(‘-05:00’, ‘utf8mb4’, ‘utf8mb4_unicode…’)
    #1 /home/myusername/public_html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(399): MailPoet\Doctrine\ConnectionFactory->createConnection()
    #2 /home/myusername/public_html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(1394): MailPoetGenerated\FreeCachedContainer->getConnectionService()
    #3 /home/myusername/public_html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(409): MailPoetGenerated\FreeCachedContainer->getEntityManagerFactoryService()
    #4 /home/myusername/public_html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(1414): MailPoetGenerated\FreeCachedContainer->getEntityManagerService()
    #5 / in /home/myusername/public_html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php on line 68

    Is MailPoet compatible with PHP 7.3? If so, any ideas what is happening?

    – Scott

    • This topic was modified 5 years, 2 months ago by sneader.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Scott!

    We use PHP 7.3 ourselves and haven’t run into this, though a few other users have reported the same.

    Does it still happen with the latest release?

    Can you let us know which MySQL or MariaDB version you’re using, please?

    Thanks!

    Same problem with me. Follows the database version;
    Server version: 5.6.35-log MySQL Community Server (GPL)

    Thread Starter sneader

    (@sneader)

    Yes, problem still exists in 3.37.1. For db server, it is 10.1.41-MariaDB. I have created a phpinfo for you, and printed to a PDF file, and shared via Google Drive:

    https://drive.google.com/file/d/1xqJ5ZQafTpVJnVkuQCa-56YlCLDFEEKi/view?usp=sharing

    FYI, I am the root server owner, so if there is any other info I can help with, let me know.

    – Scott

    giocomai

    (@giocomai)

    I had this same error message, and in my case it turned out to be related to not having the pdo extension installed.

    This is my complete dockerfile now. Without installing pdo pdo_mysql as per the dockerfile below, it would throw this exact error. This works nicely both with php 5.6.20 and php 7.3.

    If you don’t use docker, you may still want to check you have the pdo and pdo_mysql extensions enabled.

    
    FROM php:7.3-apache
    
    RUN apt-get update
    
    RUN apt-get install -y libzip-dev zlib1g-dev
    
    RUN docker-php-ext-install zip mysqli pdo pdo_mysql
    
    RUN a2enmod rewrite
    
    • This reply was modified 5 years ago by giocomai.
    • This reply was modified 5 years ago by giocomai.
    Thread Starter sneader

    (@sneader)

    I can confirm that I can fix the issue by enabling the pdo_mysql extension.

    – Scott

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP 7.3 causes fatal error’ is closed to new replies.