最近的项目需要用php访问oracle数据库,不得不在linux下给php安装oci8扩展。php也可以使用pdo访问oracle数据库,但还是需要安装客户端。
首先到oracle官网的这个页面下载相关的文件,注意要连数据库服务器的版本,一定要对应,否则安装成功也会连不上,同时也要区分32位、64位服务器,比如我要连的数据库服务器是oracle10.2.0.4,64位主机,那么我要下载下面三个文件:
1.用以下命令安装
2.安装OCI8 PHP扩展
3.然后执行命令
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR\'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH\' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH\' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR\' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf\'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-zts-20090626/
# cd /usr/local/php5/lib
本文地址:https://www.stayed.cn/item/566
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我