On a server with Debian 9, I upgraded PHP from version 7.2.13 to version 7.3.0, but now the PDO does not work anymore.
Fatal error: Uncaught Error: Class 'PDO' not found.
Libs are already installed:
root@/# apt install php7.3-pdo
Reading packages list... Ready
Building dependences tree
Reading state informations... Ready
Note, selecting 'php7.3-common' instead of 'php7.3-pdo'
php7.3-common is already the newest version (7.3.0-1+0~20181206202713.23+stretch~1.gbp076afd).
0 packages updated, 0 new packages instaled, 0 packages to be removed e 0 packages not updated.
root@/# apt install php7.3-mysql
Reading packages list... Ready
Building dependences tree
Reading state informations... Ready
php7.3-mysql is already the newest version (7.3.0-1+0~20181206202713.23+stretch~1.gbp076afd).
0 packages updated, 0 new packages instaled, 0 packages to be removed e 0 packages not updated.
root@/#
The file /etc/php/7.3/apache2/php.ini
is with pdo_mysql
enabled.
;extension=bz2
;extension=curl
;extension=fileinfo
;extension=gd2
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=interbase
;extension=ldap
;extension=mbstring
;extension=exif ; Must be after mbstring as it depends on it
;extension=mysqli
;extension=oci8_12c ; Use with Oracle Database 12c Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=shmop
The phpinfo()
informs that the /etc/php/7.3/apache2/php.ini
file is the php.ini
being used by the Apache Web Server:
Configuration File (php.ini) Path /etc/php/7.2/apache2
The phpinfo()
only returns PDO information in the "Module Authors" section:
MySQL driver for PDO George Schlossnagle, Wez Furlong, Ilia Alshanetsky, Johannes Schlueter
More information:
- Without any files
.htaccess
. - Without any files
.user.ini
. - Apache2 has already been restarted.
- I'm using the same code that worked well with PHP version 7.2.13.
Thank you!