0

I am running EE 5.3.0, hosted on Media Temple. I have been trying to upgrade to PHP 7.2 but when I do I get the white screen of death with the following error message in ee_wizard:

Fatal error: Uncaught Error: Class 'PDO' not found in /home/mydomain/public_html/ee_wizard/index.php:243 Stack trace: #0 /home/mydomain/public_html/ee_wizard/index.php(131): check_db(Array) 1 {main} thrown in /home/mydomain/public_html/ee_wizard/index.php on line 243

I also get similar Fatal error messages when I attempt to run the site after enabling PHP 7.2.

I could really use some guidance on a way to fix this problem.

Here is what my php.ini file looks like relative to PDO:

[Pdo]
; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
; http://php.net/pdo-odbc.connection-pooling
;pdo_odbc.connection_pooling=strict

;pdo_odbc.db2_instance_name


[Pdo_mysql]
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/pdo_mysql.cache_size
pdo_mysql.cache_size = 2000


; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://php.net/pdo_mysql.default-socket
pdo_mysql.default_socket=
1

Check with your host that your site has the PDO module enabled. This is pretty important as PDO (php Data Object) is an interface that enables php to access MySQL databases.

EE relies upon MySQL, and so not having access would be a fairly fatal error for it. So sounds like the error message you are getting is the right one!

It is unlikely that the php instance your host uses is missing the PDO module, but it is possible that the configuration of your 7.2 instance does not enable its use. This may be due to a typo in your php.ini file (or equivalent, depends on your hosting setup).

HTH

| improve this answer | |
  • I've added the php.ini PDO code to the question above. – forrest Apr 9 at 15:45
  • Depending on how your hosting works, it might be easier to simply talk to your host provider / isp (if there is one). If you are rolling your own server somehow, then you'll need to make sure that your instance of php has the extention installed and enabled yourself. – JCOGS Design Apr 10 at 9:08
  • 1
    I was finally able to convince the hosting provider to install the extension. Everything is working correctly now. Thanks. – forrest Apr 10 at 17:29
0

JCOGS answer is 99% likely correct. You do not have the PDO module installed. As a boilerplate command for installing dependencies for most PHP CMS and software, when setting up a server/sand-box (of course, read your software's installation instructions to see if you need anything else), I run this:

add-apt-repository ppa:ondrej/php
apt-get update
apt-get install -y apache2 git curl php7.2 mysql-server mysql-client php7.2-mysql php7.2-gd php7.2-bcmath php7.2-bz2 php7.2-cli php7.2-curl php7.2-intl php7.2-json php7.2-mbstring php7.2-opcache php7.2-soap php7.2-sqlite3 php7.2-xml php7.2-xsl php7.2-zip libapache2-mod-php7.2

Running just

apt-get install -y mysql-server mysql-client php7.2-mysql

Should get you going if that's all you're missing.

| improve this answer | |
  • When I check the PHP version and installed modules via SSH, PDO does not show up in the list of modules. When I try and run your suggested code I get the following: -bash: apt-get: command not found – forrest Apr 9 at 15:39
  • apt-get will only be available if your hosting environment allows it (many don't). If you cannot access apt-get then you need to contact your hosting administrator to get them to sort out the issue for you. – JCOGS Design Apr 10 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.