当前位置:网站首页>How to change php INI file supports PDO abstraction layer

How to change php INI file supports PDO abstraction layer

2022-07-06 10:31:00 Yisu cloud

How to change php.ini File support pdo Abstraction layer

This article introduces “ How to change php.ini File support pdo Abstraction layer ” Knowledge about , During the operation of the actual case , Many people will encounter such difficulties , Next, let Xiaobian lead you to learn how to deal with these situations ! I hope you will read carefully , Be able to learn !

Method :1、 Open profile “php.ini”;2、 lookup “pdo_firebird”、“pdo_oci”、“pdo_odbc”、“pdo_pgsql” etc. PDO Related configuration information , Put the semicolon in front of the configuration item “;” Remove ;3、 restart Apache The server that will do .

 How to change php.ini File support pdo Abstraction layer

The operating environment of this tutorial :windows7 System 、PHP7.1 edition 、DELL G3 The computer

PDO What is it?

PDO yes PHP Date Object(PHP Data objects ) For short , It is PHP A lightweight..., defined for accessing a database 、 A consistent interface , It provides a data access abstraction layer , So no matter what database you use , You can query and obtain data through the same function , Greatly simplifies the operation of the database , And can shield the difference between different databases .

PDO Is with the PHP5.1 Version released together , Use PDO It is very convenient to develop cross database programs , And the migration between different databases , at present PDO Supported databases include Firebird、FreeTDS、Interbase、MySQL、SQL Server、ODBC、Oracle、Postgre SQL、SQLite and Sybase etc. .

With PDO You don't have to use it anymore mysqli_* A series of functions , Just use PDO The method in can operate the database .

Turn on PDO

PDO Is with the PHP5.1 Together with , Default included in PHP5.1 in . because PDO need PHP5 Support for core object-oriented features , Therefore, it cannot be PHP5.0 In previous versions .

By default ,PDO stay PHP Medium is on , But to enable support for a database driver , Corresponding configuration operations are still needed .

With Windows Take the system as an example , In profile php.ini In the relevant PDO The relevant configuration information is as follows :

;extension=pdo_firebird
;extension=php_pdo_mysql.dll
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite

Tips : To open the corresponding configuration, you only need to remove the semicolon in front of the configuration item ;, And then restart Apache The server can .

Verify whether the relevant configuration is successfully enabled , Just execute phpinfo() Function is OK , Search the output page for the name of the configuration , If it exists, it indicates that the opening is successful , As shown in the figure below :

 How to change php.ini File support pdo Abstraction layer

“ How to change php.ini File support pdo Abstraction layer ” That's all for , Thanks for reading . If you want to know more about the industry, you can pay attention to Yisu cloud website , Xiaobian will output more high-quality practical articles for you !

原网站

版权声明
本文为[Yisu cloud]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131711093515.html