Hướng dẫn php oci8 download
Show
Đã đăng vào thg 3 23, 2019 11:40 SA 3 phút đọc Chào các bạn, hôm nay mình muốn hướng dẫn các bạn cách thêm Oracle driver vào PHP module, với mục đích là PHP có thể kết nối đến cơ sở dữ liệu của Oracle. Nào mình cũng bắt đầu nhé. 1. Download Oracle driver PHP - oci8Đầu tiên các bạn cần downoad Oracle driver PHP đó là oci8 tại page https://pecl.php.net/package/oci8/2.2.0/windows Ở đây có 3 phiên bản của PHP đó là 7.1, 7.2 và 7.3. Trong ví dụ của mình dùng 7.1 mình sẽ download 7.1 Thread Safe (TS) x86 . 1.2 Extract zip file:Tiếp đến, sau khi download thành công oracle driver oci8, các bạn extract file zip sẽ nhận được các files như trong hình 1.3. Add .ddl file to ext folderTrong folder download về, vì
mình dùng Oracle 11g nên mình sẽ copy file Lưu ý: Thay đổi path đến xampp của các bạn nhé. 1.4 Add extention to php.iniKế đến các bạn tìm đến file php.ini của XAMPP Như vậy các bạn đã thêm được oracle driver php vào php module. Kế đến để chạy được oracle driver bạn cần cài đặt instantclient-basic-nt của Oracle nữa. 1.5 Download the Oracle Instant Client Basic package from OTN.Bạn truy cập vào page: https://www.oracle.com/technetwork/topics/winsoft-085727.html để dowload. Click vào checkbox Accept License Agreement để được hiển thị link download Kế đến bạn scroll xuống dưới và download file instantclient-basic-nt-11.2.0.3.0.zip Sau khi download, extract file zip và copy vào thư mục C:\instantclient_11_21.6 Add this subdirectory to the PATH environment variable.Kế đến bạn cần thêm C:\instantclient_11_2 vào biến môi trường PATH của window để chạy oracle driver. Click vào start và tìm Tiếp đến, bạn click vào Tiếp đến, bạn click vào nút Edit Path ở ** Sau khi thêm biến môi trường, bạn cần khởi động lại máy tính để appy PATH đó. 1.7 Check Oracle driver installed?Để kiểm tra Oracle driver PHP đã được cài đặt hay chưa, các bạn mở file
Khởi động XAMPP, mở trình duyệt của bạn và vào page: http://localhost/info.php ** Nếu bạn nhìn thấy thông tin của Kết luậnNhư vậy mình đã hướng dẫn xong cho các bạn cách thêm oracle driver oci8 vào PHP module. Giờ bạn có thể kết nối project của mình đến cơ sở dữ liệu Oracle rồi nhé. Cảm ơn các bạn đã đọc bài viết của mình All rights reserved I am using windows 10(x64). an using php 7.4 and download from here... https://windows.php.net/download#php-7.4 I unzip it and placed in c:\php7.4.9 and uncomment some extension in php.ini I need to connect to oracle9i and mysql, so I uncomment the oci8_12c, oci8 and pdo_mysql my pdo_mysql works fine. Everytime I run php. it will prompt my oci and oci8_12c are not valid win32 command and the phpinfo() shows seems my oci is not installed.... I tried to find some other dll from pecl to replace the original one. Still the same. anyone can help Thanks a lot. Configuring PHP with OCI8Review the previous Requirements section before configuring OCI8. Before starting the web server, OCI8 typically requires several Oracle environment variables (see below) to locate libraries, point to configuration files, and set some basic properties such as the character set used by Oracle libraries. The variables must be set before any PHP process starts. The PHP binary must link with the same, or more recent, major version of Oracle libraries as it was configured with. For example, if you build OCI8 with Oracle 19 libraries, then PHP should also be deployed and run with Oracle 19 libraries. PHP applications can connect to other versions of Oracle Database, since Oracle has client-server cross-version compatibility. Installing OCI8 from PECL Using the pecl CommandThe OCI8 extension can be added to an existing PHP installation by using the » PECL repository.
Installing OCI8 from PECL Using phpize To install OCI8 on an existing PHP installation when the
If you are building PHP from source code, the configuration Configure OCI8 using one of the following configure options.
After configuration, follow the usual PHP building procedure, e.g. make install. The OCI8 shared extension oci8.so library will be created. It may need to be manually moved to the PHP extension directory, specified by the extension_dir option in your php.ini file. To complete installation of OCI8, edit php.ini and add the line: Installing OCI8 as a Statically Compiled Extension when Building PHPIf you are building PHP from source code, you can configure PHP to include OCI8 as a static extension using one of the following configure options.
After configuration, follow the usual PHP building procedure, e.g. make install. After successful compilation, you do not need to add oci8.so to php.ini. No additional build steps are required. Installing OCI8 on Windows The OCI8 extension can be added to an existing PHP installation by using the DLLs from » PECL repository or the libraries in your PHP installation's With Oracle 12c (or later) libraries, uncomment one of the php.ini
lines If using Instant Client, set the system PATH environment variable to the Oracle library directory. Setting the Oracle EnvironmentBefore using this extension, make sure that the Oracle environment variables are properly set for the web daemon user. If your web server is automatically started at boot time then make sure that the boot-time environment is also configured correctly.
On Red Hat Linux and variants, export variables at the end of /etc/sysconfig/httpd. Other systems with Apache 2 may use an envvars script in the Apache bin directory. A third option, the Apache To check that environment variables are set correctly, use phpinfo() and check the Environment (not the Apache Environment) section contains the expected variables. The variables that might be needed are included in the following table. Refer to the Oracle documentation for more information on all the available variables. Common Oracle Environment Variables
Less frequently used Oracle environment variables include TroubleshootingThe most common problem with installing OCI8 is not having the Oracle environment correctly set. This typically appears as a problem using oci_connect() or oci_pconnect(). The error may be a PHP error such as Call to undefined function oci_connect(), an Oracle error such as ORA-12705, or even an Apache crash. Check the Apache log files for startup errors and see the sections above to resolve this problem. While network errors like ORA-12154 or ORA-12514 indicate an Oracle network naming or configuration issue, the root cause may be because the PHP environment is incorrectly set up and Oracle libraries are unable to locate the tnsnames.ora configuration file. On Windows, having multiple versions of Oracle on the one machine can easily cause library clashes unless care is taken to make sure PHP only uses the correct version of Oracle. A utility to examine what libraries are being looked for and loaded can help resolve missing or clashing library issues, particularly on Windows.
f dot kheiri at ucl dot ac dot uk ¶ 16 years ago
alvaro at demogracia dot com ¶ 14 years ago
devolver at iastate dot edu ¶ 20 years ago
Saxon Leung ¶ 10 years ago
semenov dot v at gmail dot com ¶ 3 years ago
aliquis at die dot spammers dot die dot link-net dot org ¶ 18 years ago
Anonymous ¶ 16 years ago
ben at onshop dot co dot uk ¶ 17 years ago
neogodo at yahoo dot com dot br ¶ 18 years ago
NOSPAMPLZ!esartoni at omniaglobal dot net ¶ 19 years ago
lore_giver at lycos dot co dot uk ¶ 19 years ago
scoop at subindie dot com ¶ 16 years ago
david dot reynoldsat at ipl dot com ¶ 15 years ago
Sergey ¶ 9 years ago
Anonymous ¶ 19 years ago
= ocilogon("scott", "tiger");
$cmdstr = "select ename, sal from emp";
beer at myplace dot now ¶ 13 years ago
benstendahl at hotmail dot com ¶ 13 years ago
Wilber ¶ 2 months ago
rainer dot klier at gmx dot at ¶ 16 years ago
denis dot delamarre at chu-rennes dot fr ¶ 17 years ago
oddbec_no_more_spam_kthx at online dot no ¶ 18 years ago
mike at macgirvin.com ¶ 14 years ago
jay dot couture at gmail dot com ¶ 15 years ago
MSapp ¶ 17 years ago
kucerar at hhmi dot org ¶ 17 years ago
mark at magpies dot net ¶ 18 years ago
ed000001 at hotmail dot com ¶ 18 years ago
aleigh at tessier dot com ¶ 18 years ago
kakukkfu at mailbox dot hu ¶ 19 years ago
Marinne at ilovechocolate dot com ¶ 21 years ago
bluei at phpworld dot org ¶ 21 years ago
shmengie_2000 at yahoo dot com ¶ 21 years ago
modir at huanga dot com ¶ 11 years ago
nicodenboer (at) yahoo (dot) com ¶ 13 years ago
john at john-warner dot com ¶ 19 years ago
|