Rumah > pembangunan bahagian belakang > tutorial php > php,pdo怎么连接oracle数据库

php,pdo怎么连接oracle数据库

WBOY
Lepaskan: 2016-06-06 20:52:13
asal
1639 orang telah melayarinya

php.ini

;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
extension=php_exif.dll
;extension=php_fdf.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_oci8.dll
;extension=php_openssl.dll
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
Salin selepas log masuk
Salin selepas log masuk

php代码

new PDO("oci:dbname=//192.168.175.40:1521/ORCL,demo,demo");
Salin selepas log masuk
Salin selepas log masuk

phpinfo
php,pdo怎么连接oracle数据库

错误

pdo_oci_handle_factory: ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务 (ext\pdo_oci\oci_driver.c:581)222
Salin selepas log masuk
Salin selepas log masuk

回复内容:

php.ini

;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
extension=php_exif.dll
;extension=php_fdf.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_oci8.dll
;extension=php_openssl.dll
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
Salin selepas log masuk
Salin selepas log masuk

php代码

new PDO("oci:dbname=//192.168.175.40:1521/ORCL,demo,demo");
Salin selepas log masuk
Salin selepas log masuk

phpinfo
php,pdo怎么连接oracle数据库

错误

pdo_oci_handle_factory: ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务 (ext\pdo_oci\oci_driver.c:581)222
Salin selepas log masuk
Salin selepas log masuk

请先安装oracle 的客户端,能够用客户端访问oracle了,才能够加载

我PHP 连接Oracle,第一次非常慢,30~45秒,之后就非常快。
这个楼主是如何解决的。

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan