问题描述
我刚刚从共享主机迁移到VPS主机,因此进行了设置.我已经安装了PDO和pdo_mysql模块.显示它们已安装.我也重新启动了apache服务器.
I have just moved to a VPS hosting from a shared hosting, so setting things up. I have installed the PDO and pdo_mysql modules. It is showed they are installed. I have restarted the apache server too.
root@li339-83:~# php -m | grep -i pdo
PDO
pdo_mysql
以下是来自phpinfo.
The following is from phpinfo.
扩展名(如下所示)在安装后自动添加
The extensions(shown below) are added automatically after installation
extension = pdo.so; //这在pdo.ini中
extension=pdo.so; //this is in pdo.ini
但是,我无法加载我的网页.以下是错误
But, I am not able to load my webpages. The following is the error
推荐答案
在 PHP.ini文件中,我们应该修改 extension_dir 指令选项.这应该指向包含 pdo.so和pdo_mysql.so 文件的目录.
In the PHP.ini file, we should modify the extension_dir directive option. This should point to the directory which contains the pdo.so and pdo_mysql.so files.
要找到这些文件所在的目录,请使用以下unix命令,
To find the directory where these files are present, use the following unix command,
重新启动apache,问题已解决.
Restart apache and the problem is fixed.
这篇关于PDO和pdo_mysql已加载,但未找到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!