朋友说想弄一个php连oracle的,所以就测试了一下
使用的软件如下:
#ls
AutoMAP-0.1.11.tar.gz
oracle-instantclient-basic-10.2.0.3-1.i386.rpm
oracle-instantclient-devel-10.2.0.3-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm
instantclient-sdk-linux32-10.2.0.3-20061115.zip
安装map,这个我就不多说了,全是自动,应该很简单,
再安装oracle的客户端
#rpm -ivh *.i386.rpm
Preparing... ########################################### [100%]
1:oracle-instantclient-ba########################################### [ 33%]
2:oracle-instantclient-de########################################### [ 67%]
3:oracle-instantclient-sq########################################### [100%]
#echo "/usr/lib/oracle/10.2.0.3/client/lib/" >> /etc/ld.so.conf.d/oracle_client.conf
#ldconfig
安装php的oci8扩展
#yum install libaio
#wget
#tar zxvf oci8-1.3.5.tgz
#cd oci8-1.3.5/
#/usr/local/php/bin/phpize
#CFLAGS="-I/usr/lib/oracle/10.2.0.3/client/"
#CXXFLAGS="-I/usr/lib/oracle/10.2.0.3/client/"
#./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=/usr/lib/oracle/10.2.0.3/client/
#make;make isntall
结果出错,,错误信息很多,好像是没头文件
#unzip instantclient-sdk-linux32-10.2.0.3-20061115.zip
#cd instantclient_10_2/sdk/include/
#cp * /root/oci8-1.3.5
#cd /root/oci8-1.3.5
#make;make intall
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20060613/
修改/usr/local/php/etc/php.ini文件
在extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"后增加一行:
extension = "oci8.so"
再重启apache,,这样就完成了!
/usr/local/php/bin/pecl install oci8
阅读(2237) | 评论(0) | 转发(0) |
/root/oci8-1.3.5/oci8.c:3082: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php_oci_ping_init'
make: *** [oci8.lo] 错误 1