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中文网!

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

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

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
