在linux上安装apache+php连接oracle10g
<DIV><P></P>
<P> <STRONG>【IT168 <A title=服务器 style="COLOR: #000000" href="http://server.it168.com/" target=_blank>服务器</A><A title=学院 style="COLOR: #000000" href="http://school.it168.com/" target=_blank>学院</A>】</STRONG>原创文章, 当然, 参考了其它人的文章, 以及 oracle.com 上的安装说明。 </P>
<P> 所用<A title=软件 style="COLOR: #000000" href="http://software.it168.com/" target=_blank>软件</A>:<BR> linux AS 4<BR> oracle-instantclient-basic-10.1.0.4-1.i386.rpm<BR> oracle-instantclient-devel-10.1.0.4-1.i386.rpm<BR> php 4.4.2<BR> httpd-2.2.0.tar.gz 或 httpd-2.0.55.tar.gz </P>
<P> oracle 版本是 10.1.0.3 </P>
<P> 真正成功安装, 连接成功! </P>
<P> gd库的安装 </P>
<P> 安装freetype<BR> tar zxvf freetype-2.1.10.tar.gz<BR> ./configure<BR> make && make install<BR> :安装zlib<BR> tar -zxvf zlib-1.2.3.tar.gz<BR> cd zlib.1.2.3<BR> ./configure<BR> make && make install<BR> :安装libpng<BR> tar -zxvf libpng-1.2.8-config.tar.gz<BR> cd libpng-1.2.8-config<BR> cp scripts/makefile.std makefile<BR> make test<BR> make install<BR> :安装jpeg<BR> tar -zxvf jpegsrc.v6b.tar.gz<BR> cd jpeg-6b<BR> ./configure --enable-share --enable-static<BR> make; make install<BR> :安装GD<BR> tar -zxvf gd-2.0.33.tar.gz<BR> cd gd-2.0.33<BR> ./configure --prefix=/usr/local/gd --with-jpeg --with-png --with-zlib --with-freetype=/usr/local/freetype/lib<BR> make && make install<BR> 编译jpeg时报错<BR> /usr/bin/install -c -m 644 ./cjpeg.1 <BR> /usr/local/man/man1/cjpeg.1<BR> /usr/bin/install: cannot create regular file <BR> `/usr/local/man/man1/cjpeg.1'': No such file or directory</P>
<P> 缺少/usr/local/man目录及man1子目录,新建后重新编译。<BR> shell> mkdir /usr/local/man<BR> shell> mkdir /usr/local/man/man1</P>
<P> 安装apache<BR> 先把 httpd-2.2.0.tar.gz 上传到 /root<BR> cd<BR> tar zxvf httpd-2.2.0.tar.gz<BR> cd httpd-2.2.0<BR> ./configure --prefix=/usr/local/apache2 <BR> make && make install</P>
<P> 在 Linux 上启用 PHP OCI8 扩展 <BR> 从 OTN 上的 Instant Client 页面下载 Basic 和 SDK Instant Client 程序包。这两个 RPM 的总大小大约为 30MB。 <BR> 以 root 用户的身份安装 RPM。<BR> rpm -Uvh oracle-instantclient-basic-10.1.0.4-1.i386.rpm<BR> rpm -Uvh oracle-instantclient-devel-10.1.0.4-1.i386.rpm<BR> 第一个 RPM 将 Oracle 库置于 /usr/lib/oracle/10.1.0.4/client/lib 中,第二个 RPM 在 /usr/include/oracle/10.1.0.4/client 中创建头 (header)。</P>
<P> 安装php<BR> 先把 php-4.4.2.tar.gz 上传到 /root<BR> cd<BR> tar zxvf php-4.4.2.tar.gz<BR> cd php-4.4.2 <BR> ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-oci8-instant-client=/usr/lib/oracle/10.1.0.4/client/lib --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --with-zlib --with-png --with-jpeg --with-freetype --enable-gd-native-ttf --with-ttf<BR> make && make install<BR> cp php.ini-dist /usr/local/php/etc/php.ini </P>
<P> 在 http.conf 末添加<BR> LoadModule php4_module modules/libphp4.so<BR> AddType application/x-httpd-php .php<BR> AddType application/x-httpd-php .phtml<BR> AddType application/x-httpd-php-source .phps </P>
<P> 把 DocumentRoot "/usr/local/apache2/htdocs" 改成 DocumentRoot "你的目录" , <Directory "/usr/local/apache2/htdocs"> 改成 <Directory "你的目录"> </P>
<P> 写一个文件 test.php<BR> <?<BR> phpinfo();<BR> ?><BR> 如果里面有 oci8 的信息,则表示安装成功! </P></DIV>
页:
[1]