2

i have install php8.1-fpm and setup it with apache2/FGPI. But after many operation, impossible to "enable pdo-mysql".

i have make this sudo apt-get install php8.1-pdo-mysql

with result

Note, selecting 'php8.1-mysql' instead of 'php8.1-pdo-mysql'
php8.1-mysql is already the newest version (8.1.5-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

But, when i do php -m

mysql not appear.

[PHP Modules]
Core
curl
date
dom
filter
gd
gmp
hash
igbinary
imap
intl
json
libxml
mbstring
OAuth
openssl
pcntl
pcre
redis
Reflection
session
SimpleXML
sodium
SPL
standard
xdebug
xml
xmlreader
xmlwriter
xsl
yaml
zip
zlib

[Zend Modules]
Xdebug

When i try to know why, it seem because Pdo is include on php8.1-common, but ... not appear to.

An other action that i have doing is to remove php8.1-mysql and reinstall php8.11-pdo-mysql with sudo apt-get install php8.1-pdo-mysql, the result isResult of apt-get install

but, nothing on mods-available

mods-available

EDIT 1 When i look with phpinfo() on a php file to use php-fpm, i have this result

/etc/php/8.1/fpm/conf.d/15-xml.ini, 
/etc/php/8.1/fpm/conf.d/20-curl.ini, 
/etc/php/8.1/fpm/conf.d/20-dom.ini, 
/etc/php/8.1/fpm/conf.d/20-gd.ini, 
/etc/php/8.1/fpm/conf.d/20-gmp.ini, 
/etc/php/8.1/fpm/conf.d/20-igbinary.ini, 
/etc/php/8.1/fpm/conf.d/20-imap.ini, 
/etc/php/8.1/fpm/conf.d/20-intl.ini, 
/etc/php/8.1/fpm/conf.d/20-mbstring.ini, 
/etc/php/8.1/fpm/conf.d/20-oauth.ini, 
/etc/php/8.1/fpm/conf.d/20-redis.ini, 
/etc/php/8.1/fpm/conf.d/20-simplexml.ini, 
/etc/php/8.1/fpm/conf.d/20-xdebug.ini, 
/etc/php/8.1/fpm/conf.d/20-xmlreader.ini, 
/etc/php/8.1/fpm/conf.d/20-xmlwriter.ini,     
/etc/php/8.1/fpm/conf.d/20-xsl.ini,         
/etc/php/8.1/fpm/conf.d/20-yaml.ini, 
/etc/php/8.1/fpm/conf.d/20-zip.ini

EDIT2 When i use php8.1-mysql instead of php8.1-pdo-mysql same result because apt automaticly switch on php8.1-mysql when you try to install pdo-mysql.

EDIT3 The command sudo phpenmod pdo_mysql take the result

WARNING: Module pdo_mysql ini file doesn't exist under /etc/php/8.1/mods-available
WARNING: Module pdo_mysql ini file doesn't exist under /etc/php/8.1/mods-available

This is the real problem, that the needed file never been created by sudo apt-get install php8.1-mysql

Alex
  • 77
  • 1
  • 1
  • 7

1 Answers1

-1

Thx for your comment. I have find the solution in an other post :

https://stackoverflow.com/a/64661113/19034672

I have doing the --purge of all php installed, and reinstall php-fpm, and all is done.

Alex
  • 77
  • 1
  • 1
  • 7