This article mainly introduces the core steps of connecting PHP to the Oracle database, and briefly analyzes the PHP installation Oracle extension settings and connection test code. It is very simple and easy to understand. Friends in need can refer to it.
The details are as follows:
1. Modify the php.ini file and open the extension=php_oci8.dll extension.
2. Copy the php installation directory/ext/php_oci8.dll file to the system32 directory.
3. Test code:
$conn = oci_connect("scott", "tiger", $db); if (!$conn) { $e = oci_error(); print htmlentities($e['message']); exit; }else { echo "连接oracle成功!"; }
Summary: The above is the entire content of this article, I hope it will be helpful to everyone's learning.
Related recommendations:
phpTo achieve invalid flush, phpreal-time output method under IIS7
Notes on the use of the PHP flush function
phpSharing of methods for developing custom menus on WeChat
The above is the detailed content of Core steps and brief analysis of php connecting to oracle database. For more information, please follow other related articles on the PHP Chinese website!