Support » Plugin: MailPoet - emails and newsletters in WordPress » Error when activating Mailpoet 3

  • Hi I am doing some local development on my system. When I try to install mailpoet I am getting an error on activation and the plugin doesn’t activate.

    Here is the error

    Fatal error: Uncaught Error: Undefined class constant ‘MYSQL_ATTR_INIT_COMMAND’ in /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php:68 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php(36): MailPoet\Doctrine\ConnectionFactory->getDriverOptions(‘+00:00’, ‘utf8mb4’, ‘utf8mb4_unicode…’) #1 /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(399): MailPoet\Doctrine\ConnectionFactory->createConnection() #2 /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(1394): MailPoetGenerated\FreeCachedContainer->getConnectionService() #3 /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(409): MailPoetGenerated\FreeCachedContainer->getEntityManagerFactoryService() #4 /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(1414): MailPoetGenerated\FreeCachedContainer->getEntityManagerService() #5 /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(142 in /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php on line 68

    Local development environment:
    mysql: 5.7
    Wordpress: 5.2.3

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Don’t expect a response for this. Mail Poet continues to evade and ignore requests to fix the issue of their platform not being compatible with PhP 7.3. We are currently testing other options and plan to leave Mail Poet ASAP.

    Thanks,

    I was starting to think about that. What are you testing? I am looking at:

    https://wordpress.org/plugins/newsletter/

    Plugin Author MailPoet

    (@wysija)

    Hi there @johnkgibson,

    Sorry about the delay with our response. I’ve just tested and haven’t been able to replicate this and many of us personally use PHP 7.3 as part of our development environments.

    Can you post the full configuration of your development environment including Apache/Nginx configurations?

    Thanks!

    I have the same issue, I’m using the docker wordpress image 5.2.4-php7.3

    here’s the error that shows up upon activation:
    Fatal error: Uncaught Error: Undefined class constant ‘MYSQL_ATTR_INIT_COMMAND’ in /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php on line 68 Error: Undefined class constant ‘MYSQL_ATTR_INIT_COMMAND’ in /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php on line 68 Call Stack: 0.0000 405592 1. {main}() /var/www/html/wp-admin/plugins.php:0 0.4876 6020224 2. plugin_sandbox_scrape() /var/www/html/wp-admin/plugins.php:175 0.4877 6020632 3. include(‘/var/www/html/wp-content/plugins/mailpoet/mailpoet.php’) /var/www/html/wp-admin/includes/plugin.php:2141 0.4884 6021824 4. require_once(‘/var/www/html/wp-content/plugins/mailpoet/mailpoet_initializer.php’) /var/www/html/wp-content/plugins/mailpoet/mailpoet.php:102 0.4984 6127008 5. MailPoet\DI\ContainerWrapper->get() /var/www/html/wp-content/plugins/mailpoet/mailpoet_initializer.php:67 0.4984 6127008 6. MailPoetGenerated\FreeCachedContainer->get() /var/www/html/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php:30 0.4984 6127384 7. MailPoetGenerated\FreeCachedContainer->getInitializerService() /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php:274 0.5056 6136864 8. MailPoetGenerated\FreeCachedContainer->getActivatorService() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:976 0.5065 6137616 9. MailPoetGenerated\FreeCachedContainer->getPopulatorService() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:943 0.5105 6209976 10. MailPoetGenerated\FreeCachedContainer->getFeaturesControllerService() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:1446 0.5116 6211456 11. MailPoetGenerated\FreeCachedContainer->getFeatureFlagsRepositoryService() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:1588 0.5131 6213568 12. MailPoetGenerated\FreeCachedContainer->getEntityManagerService() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:1578 0.5131 6213568 13. MailPoetGenerated\FreeCachedContainer->getEntityManagerFactoryService() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:463 0.5136 6214384 14. MailPoetGenerated\FreeCachedContainer->getConnectionService() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:1528 0.5157 6224568 15. MailPoet\Doctrine\ConnectionFactory->createConnection() /var/www/html/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:453 0.5158 6326424 16. MailPoet\Doctrine\ConnectionFactory->getDriverOptions() /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/ConnectionFactory.php:36

    UPDATE: What we found out was that Mail Poet was no longer supporting Mail Poet 2, which worked fine under php 7.2 There is a new Mail Poet 3 that is compatible with php 7.3 so we installed that. It’s an entirely different program so there’s a bit of a learning curve but we think it’s going to work ok for us.

    So, the best advice I can give is to ditch Mail Poet 2 and go with Mail Poet 3 unless of course, you choose to stay with php 7.2

    As I see one of the comments above mentions using the php docker image, it turns out you can solve it by installing the pdo extensions.

    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 with both php 5.6.20 and with 7.3.

    
    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 2 months, 2 weeks ago by giocomai.
    • This reply was modified 2 months, 2 weeks ago by giocomai.
    • This reply was modified 2 months, 2 weeks ago by giocomai.

    @giocomai works like a charm, thank you !

    @giocomai – thanks, well done! 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.