thinkphp Connect Oracle configuration notation (use the OCI extension instead of the PDO notation)

Source: Internet
Author: User
Tags dsn

Tested many times, TP official website did not give the correct wording, and the search on the internet is all wrong.

Tracking code, finally found the correct configuration, backup as follows, (by default7#zbphp.com)


    ' Db_type '            = ' Oracle ',//database type    ' db_host '            = ' oracle.zbphp.com ',//server address    ' db_name ' +            ' (Description= (address= (protocol=tcp) (host=oracle.zbphp.com) (port=1029)) (Connect_data= (SID=ORCL))) ',//server address    ' db_user '            = ' zbphp ',//user name    ' db_pwd '             = ' fuzb ',//password    ' db_port ' +            1029,//Port    ' db_prefix ' = '          tb_ ',//database table prefix    ' db_charset ' = '         utf8 ',//Character set    ' db_params '          = > Array (        ' persist ' + = true,//note, this one must be written    ),


Special emphasis: TP website said TP support PDO, Oracle, but if using PDO can not connect DSN with MSSQL, Oracle, OCI string dsn!

Tip To download PDO extensions on official website! (Welcome Exchange by Default7#zbphp.com)



#: With the configuration reference found on the website, it is impossible to connect to Oracle, whether using PDO or OCI





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.