|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-11 10:18 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Description: ------------ I'm using PDO to connect to a MySQL-database. I moved my website to a new server, and when I opened the site I saw an error saying that the MySQL-plugin for PDO wasn't installed. In the error-text was my MySQL login-data displayed. Reproduce code: --------------- Run this code on a server without the MySQL-plugin for PDO: <?php $db = new PDO('mysql:host=host;dbname=db', 'usr', 'pass'); ?> Expected result: ---------------- A PDO-object in $db. Actual result: -------------- Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /home/***/domains/***/public_html/db.php:2 Stack trace: #0 /home/***/domains/***/public_html/***.php(2): PDO- >__construct('mysql:host=host...', 'usr', 'pass') #1 {main} thrown in /home/***/domains/***/public_html/db.php on line 2