Stuck on composer install - Undefined constant PDO::MYSQL_ATTR_USE_BUFFERED_QUERY

Trying to get this installed on a fresh debian 12 LAMP stack VM based upon the requirements defined on your site.

Your software
My Mautic version is: 5.0.4
My PHP version is: 8.1.28
My Database type and version is: mysql Ver 15.1 Distrib 10.11.6-MariaDB,

Many errors encountered during the install process outlined on github but I’m now stuck on this one:

composer install

> bin/console mautic:assets:generate
PHP Fatal error:  Uncaught Error: Undefined constant PDO::MYSQL_ATTR_USE_BUFFERED_QUERY in /var/www/html/app/config/config.php:160

These errors are showing in the log: N/A

Steps I have tried to fix the problem: Searched the forum and internet

What are those PHP “requirements defined on [your] site” and what is your actual configuration?

I’m following the instructions on the github page and the mautic.org site. The pre-install requirements are defined here: Requirements - Mautic Community.

Debian12, Apache2, and the versions of PHP, mariadb, and Mautic listed above are all installed and operational.

Then the github site says this:

How to install Mautic

You must already have Composer available on your computer because this is a development release and you’ll need Composer to download the vendor packages.

Also note that if you have DDEV installed, you can run ‘ddev config’ followed by ‘ddev start’. This will kick off the Mautic first-run process which will automatically install dependencies and configure Mautic for use. :sparkles: :rocket: Read more here

Installing Mautic is a simple three-step process:

  1. Download the repository zip then extract the zip to your web root.
  2. Run the composer install command to install the required packages.
  3. Open your browser and complete the installation through the web installer.

If you get stuck, check our our general troubleshooting page. Still no joy? Join our lively Mautic Community for support and answers.

The error happens on step 2 above while running the composer install command.

A little poking around in the config.php file says this from a package which called Doctrine which is needed by Symfony. But I don’t know what to do about the error or why the mautic:assets:generate is complaining about it.

Your problem is most likely that you aren’t satisfying the PHP requirements

i.e.
Are you sure that your PDO module is properly installed?

I would invite you once again to share your actual configuration.

I guess I’m not sure what you want for ‘actual configuration’. Happy to post anything you need but I need some guidance. Thanks.

What are your actual PHP module loaded?

That would be an excellent start

Here is a list of the php modules loaded:

#php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

PDO is there. So it must be something else.

“#”

Are you using root to manage a PHP web app? That wouldn’t be a good idea (guaranteed breakage)

Other than that, I would look at the Apache+MySQL module.

Have you installed the php-mysql module?

sudo apt-get install php-mysql

I installed the php8.1-mysql as suggested and the composer install finished.
I am using root to get things sorted but will switch to www-data once running with users. Thanks for the help.

1 Like