Eloquent requires PDO

If you want to use the Eloquent ORM in Laravel or integrated in some other framework, you have to consider if the PDO driver is installed and activated in your server because Eloquent requires PDO. If only MySQLi is installed, it won’t work and will crash spitting errors such as.

Fatal error: Class 'PDO' not found in...

Aunque el driver PDO viene incluido de manera predeterminada desde PHP 5.1 en adelante, es posible que no se encuentre activado o se haya desinstalado por alguna razón. Podemos instalar el driver con

The PDO driver should be installed by default since PHP 5.1 and onwards, however, it may not be activated or it could be disabled. We can install it by executing the following statements.

sudo apt-get install php5-mysql
sudo service apache2 restart

In case you compiled PHP manually, you have to use the configure option –with-pdo-mysql.

También se puede revisar el archivo php.ini y ver si la extensión del driver se encuentra activada (aunque la documentación oficial de PHP no recomienda esto) , sino se puede agregar la siguiente línea.

You can also check the php.ini file and confirm whether the drive extension is activated (PHP official documentation discourages this type of installation), if not, add the following line.


Then restart apache and it should work now.