PDO drivers缺少功能怎么办
PDO drivers缺少功能怎么办?
具体问题:
ii libapache2-mod-php5 5.3.10-1ubuntu3.8 server-side, HTML-embedded scripting language (Apache 2 module) ii libsqlite3-0 3.7.17-1+debphp.org~precise+2 SQLite 3 shared library ii php-pear 5.3.10-1ubuntu3.8 PEAR - PHP Extension and Application Repository ii php5 5.3.10-1ubuntu3.8 server-side, HTML-embedded scripting language (metapackage) ii php5-cgi 5.3.10-1ubuntu3.8 server-side, HTML-embedded scripting language (CGI binary) ii php5-cli 5.3.10-1ubuntu3.8 command-line interpreter for the php5 scripting language ii php5-common 5.3.10-1ubuntu3.8 Common files for packages built from the php5 source ii php5-curl 5.3.10-1ubuntu3.8 CURL module for php5 ii php5-dev 5.3.10-1ubuntu3.8 Files for PHP5 module development ii php5-gd 5.3.10-1ubuntu3.8 GD module for php5 ii php5-mysql 5.3.10-1ubuntu3.8 MySQL module for php5 ii php5-odbc 5.3.10-1ubuntu3.8 ODBC module for php5 ii php5-sqlite 5.3.10-1ubuntu3.8 SQLite module for php5 ii php5-sybase 5.3.10-1ubuntu3.8 Sybase / MS SQL Server module for php5
安装了这些包。按照我以往的经验应该在phpinfo()中得到一下的驱动
PDO drivers dblib, mysql, odbc, sqlite
但是只得到了
PDO drivers mysql
请问可能是什么问题?会与apache的配置有关吗?
解决办法:
原因是:你装错包了
php5-mysql包对应的是mysql_*系列函数,如mysql_query(),这个包与pdo无关。
如果你要用pdo操作mysql,就要安装这两个包:php5-pdo php5-pdo_mysql,不需要php5-mysql。
同理,pgsql, sybase, sqlite等数据库的pdo支持对应的包名是:php5-pdo_pgsql, php5-pdo_sybase, php5-pdo_sqlite
更多相关技术文章,请访问PHP中文网!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.
