简体   繁体   English

编辑php.ini文件以解决不需要的异常

[英]Editing php.ini file to solve unwanted exception

I'm in the middle of transferring my site over to another server and ran across this error when trying to load the main index file: 我正在将站点转移到另一台服务器,并且在尝试加载主索引文件时遇到了此错误:

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /htdocs/www/demoportal/login.php:8 Stack trace: #0 /htdocs/www/demoportal/login.php(8): PDO->__construct('mysql:host=db2....', '???', '???') #1 /htdocs/www/demoportal/index.php(3): require('/htdocs/www/dem...') #2 {main} thrown in /htdocs/www/demoportal/login.php on line 8

The line that apparently is giving an error is the following: 显然出现错误的行如下:

$db = new PDO("mysql:host=" . $host . ";dbname=" . $database, $user, $password);

The version of PHP on my system is PHP Version 5.3.19-1~dotdeb.0. 我系统上的PHP版本是PHP版本5.3.19-1〜dotdeb.0。

在此处输入图片说明

I'm not sure what I need to look for in the php.ini file to modify or edit. 我不确定需要在php.ini文件中查找什么以进行修改或编辑。 Any help would be appreciated. 任何帮助,将不胜感激。

您没有安装/加载MySQL PDO驱动程序。

我需要在php.ini文件中查找的内容

extension=php_pdo_mysql.so (or .dll)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM