{"id":2880,"date":"2013-10-10T16:28:59","date_gmt":"2013-10-10T20:28:59","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/10\/10\/fatal-error-class-pdo-not-found\/"},"modified":"2022-05-12T14:41:32","modified_gmt":"2022-05-12T18:41:32","slug":"fatal-error-class-pdo-not-found","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/","title":{"rendered":"Fatal Error: Class &#8216;PDO&#8217; Not Found"},"content":{"rendered":"\n<p>When working with Content Management Systems such as Drupal or other programs in your hosting account, you may run across certain errors during either the initial setup or even after a php or Apache upgrade on your server. One common error you may run across when trying to enter your site is the <strong>PDO error<\/strong>. It looks like the one below.<\/p>\n\n\n\n<div class=\"alert alert-danger\" role=\"alert\"><strong>Fatal error: Class \u2018PDO\u2019 not found<\/strong> in \/home\/\/public_html\/core\/lib\/Drupal\/Core\/Database\/Driver\/mysql\/Connection.php on line 72.<\/div>\n\n\n\n<p>This particular one occurred after an easyapache upgrade of <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/easyapache\/upgrade-apache\/\">Apache<\/a> and <a href=\"https:\/\/www.inmotionhosting.com\/support\/product-guides\/vps-hosting\/how-to-install-php-versions-in-easyapache-4\/\">PHP<\/a>. Below are the things you should check in order to correct the issue.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#modules\">Check the PHP Modules List to See if It Is Enabled<\/a><\/li><li><a href=\"#phpini\">Ensure They Are Being Called in the php.ini File<\/a><\/li><li><a href=\"#recursive\">Ensure the php.ini File Is Recursive<\/a><\/li><li><a href=\"#extension\">Check the Extension Directory for PHP<\/a><\/li><li><a href=\"#ext_dir\">Comment Out the extension_dir in php.ini<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"modules\">Check the PHP Modules List to See if It Is Enabled<\/h2>\n\n\n\n<p>The first thing we should check is to see if the server has the PDO extensions enabled.<\/p>\n\n\n\n<ol class=\"article_list wp-block-list\"><li><a href=\"\/support\/server\/ssh\/how-to-login-ssh\/\">Log into your server via SSH<\/a>.<\/li><li>Run the command below. <pre>php -m<\/pre><\/li><li>You will then be presented with a list of modules currently installed in php, listed alphabetically. Look for <strong>PDO<\/strong> in the list. If it exists, then the module is installed.<br><code>\nmysqlnd<br>&nbsp;openssl<br>&nbsp;pcre<br><span style=\"color: red;\">&nbsp;PDO<\/span><br>&nbsp;pdo_mysql<br>&nbsp;pdo_sqlite<br>&nbsp;Phar<br>&nbsp;posix<\/code><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"phpini\">Ensure They Are Being Called in the php.ini File<\/h2>\n\n\n\n<p>If the PDO is displayed in the list of currently installed php modules, you will want to check the <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/what-is-your-default-php-ini-file\/\">php.ini file<\/a> in the relevant folder to ensure they are being called. Somewhere in the php.ini file you should see the following:<\/p>\n\n\n\n<pre>extension=pdo.so<br>extension=pdo_sqlite.so<br>extension=pdo_mysql.so<br>extension=sqlite.so<\/pre>\n\n\n\n<p>If they are not present, simply add the lines above to the bottom of the php.ini file and save it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"recursive\">Ensure the php.ini File Is Recursive<\/h2>\n\n\n\n<p>You will next want to ensure that the php.ini file is being used by all the folders and files underneath the main folder. This is known as being recursive. Below is a link to our article on doing just that. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/recursive-php-ini\/\">How can I make my php.ini file recursive ?<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"extension\">Check the Extension Directory for PHP<\/h2>\n\n\n\n<p>It is also possible that the <em>php.ini<\/em> file is looking into an incorrect extension directory, especially if you just performed an update. Below are the instructions for adjusting the extensions directory in the <em>php.ini<\/em> file:<\/p>\n\n\n\n<ol class=\"article_list wp-block-list\"><li><a href=\"\/support\/server\/ssh\/how-to-login-ssh\/\">Log into your account via SSH<\/a>.<\/li><li>Navigate to the <strong>\/usr\/local\/lib\/php\/extensions<\/strong> directory.<\/li><li>Run the following command on the directory: <pre>ls -lah<\/pre> You will then see all the extension directories inside.<br><code>root@vps#### [\/usr\/local\/lib\/php\/extensions]# ls -lah drwxr-xr-x 5 root root 4.0K May 10 \u00a011:13 .\/<br> \u00a0drwxr-xr-x 15 root root 4.0K Aug 28 2021 ..\/<br> \u00a0drwxr-xr-x 2 root root 4.0K Sep 2 2010 no-debug-non-zts-20060613\/<br> \u00a0drwxr-xr-x 2 root root 4.0K May 10 11:48 no-debug-non-zts-20090626\/<br> \u00a0drwxr-xr-x 2 root root 4.0K Oct 10 10:56 no-debug-non-zts-20100525\/<\/code> <div style=\"clear: both;\"><\/li><li>Check the dates to find the most recent one. Notate the full name of that directory. In our example it is <em><strong>no-debug-non-zts-20100525<\/strong><\/em>.  <\/li><li>Now you will need to open your <em>php.ini<\/em> file. Navigate to the home directory and open the file using <em>nano<\/em>. <pre>cd \/home\/public_html<\/pre><br><pre>nano php.ini<\/pre><\/li><li>Once the file is opened, find the <strong>extension_dir <\/strong>setting and ensure that the path is the same as the latest one in your <em>\/usr\/local\/lib\/php\/extensions<\/em> directory.<br><code>; Directory in which the loadable extensions (modules) reside.<br>\u00a0extension_dir = \"\/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20100525\"<\/code><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ext_dir\">Comment Out the extension_dir in php.ini<\/h2>\n\n\n\n<p>One additional option to the above fix is to simply comment the line for the <em>extension_dir<\/em> setting out in the php.ini. Doing this does no harm as it simply makes the php use the extension directory from the main server <em>php.ini<\/em>, which is most probably the one you want. To do so, simply place a semicolon (;) at the very beginning of the line as demonstrated below.<\/p>\n\n\n\n<code>; Directory in which the loadable extensions (modules) reside.<br>&nbsp;extension_dir = \"\/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20100525\"<\/code>\n\n\n\n<p>Once you correct one or more of the above steps, you shoud no longer have any issues with the PDO error.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with Content Management Systems such as Drupal or other programs in your hosting account, you may run across certain errors during either the initial setup or even after a php or Apache upgrade on your server. One common error you may run across when trying to enter your site is the PDO error.<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\"> Read More ><\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4335],"tags":[],"class_list":["post-2880","post","type-post","status-publish","format-standard","hentry","category-error-numbers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fatal Error: Class &#039;PDO&#039; Not Found | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to fix the Class &#039;PDO&#039; not found error.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fatal Error: Class &#039;PDO&#039; Not Found | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to fix the Class &#039;PDO&#039; not found error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-10-10T20:28:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-12T18:41:32+00:00\" \/>\n<meta name=\"author\" content=\"Scott Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Scott Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\"},\"author\":{\"name\":\"Scott Mitchell\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\"},\"headline\":\"Fatal Error: Class &#8216;PDO&#8217; Not Found\",\"datePublished\":\"2013-10-10T20:28:59+00:00\",\"dateModified\":\"2022-05-12T18:41:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\"},\"wordCount\":599,\"commentCount\":13,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Website Error Numbers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\",\"name\":\"Fatal Error: Class 'PDO' Not Found | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-10-10T20:28:59+00:00\",\"dateModified\":\"2022-05-12T18:41:32+00:00\",\"description\":\"Learn how to fix the Class 'PDO' not found error.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fatal Error: Class &#8216;PDO&#8217; Not Found\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\",\"name\":\"Scott Mitchell\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fatal Error: Class 'PDO' Not Found | InMotion Hosting","description":"Learn how to fix the Class 'PDO' not found error.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/","og_locale":"en_US","og_type":"article","og_title":"Fatal Error: Class 'PDO' Not Found | InMotion Hosting","og_description":"Learn how to fix the Class 'PDO' not found error.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-10-10T20:28:59+00:00","article_modified_time":"2022-05-12T18:41:32+00:00","author":"Scott Mitchell","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Scott Mitchell","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/"},"author":{"name":"Scott Mitchell","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed"},"headline":"Fatal Error: Class &#8216;PDO&#8217; Not Found","datePublished":"2013-10-10T20:28:59+00:00","dateModified":"2022-05-12T18:41:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/"},"wordCount":599,"commentCount":13,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Website Error Numbers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/","name":"Fatal Error: Class 'PDO' Not Found | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-10-10T20:28:59+00:00","dateModified":"2022-05-12T18:41:32+00:00","description":"Learn how to fix the Class 'PDO' not found error.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/fatal-error-class-pdo-not-found\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Fatal Error: Class &#8216;PDO&#8217; Not Found"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed","name":"Scott Mitchell","url":"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2880","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2880"}],"version-history":[{"count":39,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2880\/revisions"}],"predecessor-version":[{"id":106553,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2880\/revisions\/106553"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}