Thinkphp connection to oracle Database-php Tutorial

Source: Internet
Author: User
Thinkphp connects to the oracle Database. I removed the comment in front of extension = php_oci8.dll in php. in, and changed the connection string in db. php.
Return array (
'Db _ type' => 'Oracle ',
'Db _ host' => '2017. 168.22.245 ',
'Db _ port' => '123 ',
'Db _ name' => 'zhs16gbk. llsoft ',
'Db _ user' => 'test ',
'Db _ pwd' => 'test ',
'Db _ prefix' => 'thinkphp _',
);
However, the connection fails.


Reply to discussion (solution)

The think error tracking tool opened.

1. Oracle clients must be installed for Oracle8 and later versions. check that the Oracle client has been installed.
2. the name of your database (ZHS16GBK. llsoft) is strange.
Generally, ZHS16GBK is a character set.
3. the database name should be the listening name of Oracle (the listening name in Oracle can be the same or different from the database name)

'Db _ type' => 'Oracle ', // Database TYPE
'Db _ host' => 'localhost', // server address
'Db _ name' => 'orcl ', // database NAME
'Db _ user' => '', // USER name
'Db _ pwd' => '', // password
'Db _ port' => '123', // PORT

'Db _ type' => 'Oracle ', // Database TYPE
'Db _ host' => 'localhost', // server address
'Db _ name' => 'orcl ', // database NAME
'Db _ user' => '', // USER name
'Db _ pwd' => '', // password
'Db _ port' => '123', // PORT




My connection is on.

'Db _ type' => 'Oracle ', // Database TYPE
'Db _ host' => 'localhost', // server address
'Db _ name' => 'orcl ', // database NAME
'Db _ user' => '', // USER name
'Db _ pwd' => '', // password
'Db _ port' => '123', // PORT


I can do that, but my project does not support oracle, but I still want to give it to you.

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.