{"id":207,"date":"2013-12-28T17:54:17","date_gmt":"2013-12-28T09:54:17","guid":{"rendered":"http:\/\/web.jofar.cn\/?p=207"},"modified":"2013-12-28T17:54:17","modified_gmt":"2013-12-28T09:54:17","slug":"%e8%ae%a9php%e6%94%af%e6%8c%81pdosqlite","status":"publish","type":"post","link":"https:\/\/web.jofar.cn\/?p=207","title":{"rendered":"\u8ba9PHP\u652f\u6301pdo(sqlite)"},"content":{"rendered":"<p>PDO(PHP Data Object) \u662fPHP 5\u65b0\u51fa\u6765\u7684\u4e1c\u897f\uff0c\u5728PHP 6\u90fd\u8981\u51fa\u6765\u7684\u65f6\u5019\uff0cPHP 6\u53ea\u9ed8\u8ba4\u4f7f\u7528PDO\u6765\u5904\u7406\u6570\u636e\u5e93\uff0c\u5c06\u628a\u6240\u6709\u7684\u6570\u636e\u5e93\u6269\u5c55\u79fb\u5230\u4e86PECL\uff0c\u90a3\u4e48\u9ed8\u8ba4\u5c31\u662f\u6ca1\u6709\u4e86\u6211\u4eec\u559c\u7231\u7684php_mysql.dll\u4e4b\u7c7b\u7684\u4e86\uff0c\u90a3\u600e\u4e48\u529e\u634f\uff0c\u6211\u4eec\u53ea\u6709\u4e0e\u65f6\u4ff1\u8fdb\u4e86\uff0c\u6211\u5c31\u5c0f\u8bd5\u4e86\u4e00\u628aPDO\u3002\uff08\u672c\u6587\u53ea\u662f\u5165\u95e8\u7ea7\u7684\uff0c\u9ad8\u624b\u53ef\u4ee5\u7565\u8fc7\uff0c\u5475\u5475\uff09<br \/>\n\u3010PDO\u662f\u5565\u3011<\/p>\n<p>PDO\u662fPHP 5\u65b0\u52a0\u5165\u7684\u4e00\u4e2a\u91cd\u5927\u529f\u80fd\uff0c\u56e0\u4e3a\u5728PHP 5\u4ee5\u524d\u7684php4\/php3\u90fd\u662f\u4e00\u5806\u7684\u6570\u636e\u5e93\u6269\u5c55\u6765\u8ddf\u5404\u4e2a\u6570\u636e\u5e93\u7684\u8fde\u63a5\u548c\u5904\u7406\uff0c\u4ec0\u4e48 php_mysql.dll\u3001php_pgsql.dll\u3001php_mssql.dll\u3001php_sqlite.dll\u7b49\u7b49\u6269\u5c55\u6765\u8fde\u63a5MySQL\u3001PostgreSQL\u3001MS SQL Server\u3001SQLite\uff0c\u540c\u6837\u7684\uff0c\u6211\u4eec\u5fc5\u987b\u501f\u52a9 ADOdb\u3001PEAR::DB\u3001PHPlib::DB\u4e4b\u7c7b\u7684\u6570\u636e\u5e93\u62bd\u8c61\u7c7b\u6765\u5e2e\u52a9\u6211\u4eec\uff0c\u65e0\u6bd4\u70e6\u7410\u548c\u4f4e\u6548\uff0c\u6bd5\u7adf\uff0cphp\u4ee3\u7801\u7684\u6548\u7387\u600e\u4e48\u80fd\u591f\u6211\u4eec\u76f4\u63a5\u7528C\/C++\u5199\u7684\u6269\u5c55\u659c\u7387\u9ad8\u634f\uff1f\u6240\u4ee5\u561b\uff0cPDO\u7684\u51fa\u73b0\u662f\u5fc5\u7136\u7684\uff0c\u5927\u5bb6\u8981\u5e73\u9759\u5b66\u4e60\u7684\u5fc3\u6001\u53bb\u63a5\u53d7\u4f7f\u7528\uff0c\u4e5f\u8bb8\u4f60\u4f1a\u53d1\u73b0\u80fd\u591f\u51cf\u5c11\u4f60\u4e0d\u5c11\u529f\u592b\u54e6\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3010\u5b89\u88c5PDO\u3011<\/p>\n<p>1.\u9996\u5148\u627e\u5230\u7cfb\u7edf\u7684php\u914d\u7f6e\u6587\u4ef6\uff0c\u4e00\u822c\u5728\uff1aC:\\WINDOWS\\php.ini.<\/p>\n<p>2.\u6253\u5f00 c:\\windows\\php.ini \uff0c\u90a3\u662f\u6211\u7684PHP\u914d\u7f6e\u6587\u4ef6\uff0c\u627e\u5230\u4e0b\u9762\u8fd9\u884c\uff1a<br \/>\nextension_dir<br \/>\n\u8fd9\u4e2a\u5c31\u662f\u6211\u4eec\u6269\u5c55\u5b58\u5728\u7684\u76ee\u5f55\uff0c\u6211\u7684PHP 5\u6269\u5c55\u662f\u5728\uff1aC:\\php5\\ext\uff0c\u90a3\u4e48\u6211\u5c31\u628a\u8fd9\u884c\u6539\u6210\uff1a<\/p>\n<p>extension_dir?=?&#8221;C:\/php5\/ext&#8221;<\/p>\n<p>\u7136\u540e\u518d\u5f80php.ini\u4e0b\u9762\u627e\u5230\uff1a<\/p>\n<div>;;;;;;;;;;;;;;;;;;;;;;<br \/>\n;?Dynamic?Extensions?;<br \/>\n;;;;;;;;;;;;;;;;;;;;;;<\/div>\n<p>\u4e0b\u9762\u6709\u4e00\u5806\u7c7b\u4f3c ;extension=php_mbstring.dll \u7684\u4e1c\u897f\uff0c\u8fd9\u91cc\u5c31\u662fPHP\u6269\u5c55\u52a0\u8f7d\u7684\u914d\u7f6e\u4e86\uff0c\u6211\u4eec\u518d\u6700\u540e\u9762\u6dfb\u52a0\u4e0a\u6211\u4eecPDO\u7684\u6269\u5c55\uff1a<\/p>\n<div>extension=php_pdo.dll<br \/>\nextension=php_pdo_mysql.dll<br \/>\nextension=php_pdo_pgsql.dll<br \/>\nextension=php_pdo_sqlite.dll<br \/>\nextension=php_pdo_mssql.dll<br \/>\nextension=php_pdo_odbc.dll<br \/>\nextension=php_pdo_firebird.dll<br \/>\n;extension=php_pdo_oci8.dll<\/div>\n<p>\u5404\u79cdPDO\u7684\u9a71\u52a8\uff0c\u80fd\u7ed9\u52a0\u4e0a\u7684\u5168\u7ed9\u52a0\u4e0a\uff0c\u4e0d\u8fc7\u540e\u9762\u7684php_pdo_oci8.dll\uff0c\u56e0\u4e3a\u6211\u6ca1\u6709\u5b89\u88c5Oralce\u6570\u636e\u5e93\uff0c\u6240\u4ee5\u6ca1\u6709\u8fd9\u4e2a\uff0c\u5c31\u4f7f\u7528\u5206\u53f7\u6ce8\u91ca\u6389\u5b83\u3002\u7136\u540e\u91cd\u542f\u6211\u4eec\u7684Web\u670d\u52a1\u5668\u3002<br \/>\n\u91cd\u542f\u540e\uff0c\u5728\u6211\u4eecWeb\u670d\u52a1\u5668\u7684\u6587\u6863\u76ee\u5f55\u4e0b\u5199\u4e00\u4e2atest.php\u7684\u6587\u4ef6\uff0c\u52a0\u4e0a\u8fd9\u4e9b\uff1a<\/p>\n<p>&lt;?<br \/>\nphpinfo();<\/p>\n<p>?&gt;<\/p>\n<p>\u7136\u540e\u6253\u5f00\u6d4f\u89c8\u5668,\u6d4f\u89c8\u5668\u91cc\u9762\u8f93\u5165\uff1a\uff0c\u5982\u679c\u4f60\u7684\u8fd9\u4e2a\u9875\u9762\u8def\u5f84\u4e0d\u4e00\u81f4\uff0c\u8bf7\u81ea\u884c\u8f93\u5165\u3002<br \/>\n\u8f93\u51fa\u7684\u5185\u5bb9\u4e2d\uff0c\u5982\u679c\u4f60\u80fd\u591f\u987a\u5229\u7684\u770b\u5230\uff1a<\/p>\n<div><img decoding=\"async\" alt=\"\" src=\"http:\/\/web.jofar.cn\/wp-content\/uploads\/2013\/12\/6adf97f83acf6453d4a6a4b1070f3754.gif\" \/>PDO<br \/>\n<img decoding=\"async\" alt=\"\" src=\"http:\/\/web.jofar.cn\/wp-content\/uploads\/2013\/12\/6adf97f83acf6453d4a6a4b1070f3754.gif\" \/>PDO?support?enabled<br \/>\n<img decoding=\"async\" alt=\"\" src=\"http:\/\/web.jofar.cn\/wp-content\/uploads\/2013\/12\/6adf97f83acf6453d4a6a4b1070f3754.gif\" \/>PDO?drivers??mysql,?pgsql,?sqlite,?mssql,?odbc,?firebird<\/div>\n<p>\u540e\u9762\u6709\u5404\u79cd\u9a71\u52a8\u7684\u8bf4\u660e\uff0c<br \/>\nPDO_Firebird\uff0cpdo_mssql\uff0cpdo_mysql\uff0cPDO_ODBC\uff0cpdo_pgsql\uff0cpdo_sqlite<\/p>\n<p>\u90a3\u4e48\uff0c\u606d\u559c\u4f60\u5b89\u88c5\u6210\u529f\u4e86\uff0c\u5426\u5219\u8bf7\u4ed4\u7ec6\u68c0\u67e5\u4e0a\u9762\u7684\u6b65\u9aa4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PDO(PHP Data Object) \u662fPHP 5\u65b0\u51fa\u6765\u7684\u4e1c\u897f\uff0c\u5728PHP 6\u90fd\u8981\u51fa\u6765\u7684\u65f6\u5019\uff0cPHP 6\u53ea\u9ed8\u2026 <span class=\"read-more\"><a href=\"https:\/\/web.jofar.cn\/?p=207\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,10,12,5],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-cloud","category-mysql","category-server","category-practice-readme"],"_links":{"self":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207"}],"version-history":[{"count":0,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions"}],"wp:attachment":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}