title: Fatal error: Class 'PDO' not found ( but it is installed and works on the terminal )
body: <p>I got into a very odd situation.</p>
  
  <p>My website hosted on a shared hosting, from out of the blue, stopped working reporting <strong>Fatal error: Class 'PDO' not found</strong></p>
  
  <p>So I created a verification file called <strong>test.php</strong> and placed it in the public_html folder.</p>
  
  <p>test.php:</p>
  
  <pre><code>&lt;?php
  if (class_exists('PDO')) {
    print "PDO is installed"; 
  }
  else {
    print "PDO NOT installed";
  }
  
  phpinfo();
  ?&gt;
  </code></pre>
  
  <p>So the above script checks if the PDO class is present and right after that prints php info about what is installed and enabled.</p>
  
  <p>So first I did some tests on the SSH Terminal:</p>
  
  <ul>
  <li>Before running the test.php I checked for the installed modules: <strong>$ php -m</strong> and both PDO and PDO_mysql were there;</li>
  <li>Then I ran <strong>$ cd public_html $ php -f test.php</strong>. It returned that the PDO class was installed and both PDO and PDO_mysql were listed from the phpinfo() call.</li>
  </ul>
  
  <p>Then I ran the test.php on the web browser. It returned PDO NOT installed and either PDO and PDO_mysql were listed in the phpinfo() print call.</p>
  
  <p>What could possibly cause such a behaviour?</p>
  
  <blockquote>
    <p>UPDATE:</p>
    
    <p>I have already tried to add the extension lines below into the php.ini but
    the issue persisted. I also made sure I had added those line into the
    right php.ini file by calling <strong>get_cfg_var('cfg_file_path')</strong></p>
    
    <p>extension=pdo.so</p>
    
    <p>extension=pdo_mysql.so</p>
  </blockquote>