首页 > 服务器 > Web服务器 > 正文

LAOP 安装全过程

2019-10-13 18:40:47
字体:
来源:转载
供稿:网友
呵呵,纯粹玩笑,仅供自己备忘。“老婆”是指LAOP,也就是Linux+Apache+Oracle+PHP,我们公司的开发应用环境。
 
因为接触后觉得比别的Linux配置和使用起来更简洁方便,所以Linux我选了Ubuntu 6.10 Server,用于公司已经有现成的Oracle数据库服务器了,所以只安装了Oracle XE client。下面是实战过程记录:
 
一、基本安装
 
进行Ubuntu 6.10 server和Apache、PHP等的安装,懒点的可以在安装Ubuntu时候选择装好LAMP。具体安装过程可以参考http://www.ubuntu.org.cn上的文档,这里我也不再唠叨了。
 
二、安装Oracle XE client
 
以能够使用sudo的普通用户登陆并编辑apt源列表文件
 

sudo vi /etc/apt/sources.list

在sources.list文件中加入下面行

deb http://oss.oracle.com/debian unstable main non-free

存盘退出并执行下面命令:

sudo groupadd oracle; sudo groupadd dba

sudo useradd -d /home/oracle -g oracle -G dba -m -s /bin/bash oracle

sudo apt-get update

sudo apt-get install bc libaio

sudo apt-get install oracle-xe-client

安装好oracle-xe-client后,oracle用户还需配置一下各种环境参数,可以利用

/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin/oracle_env.sh

进行设置或者直接把环境参数添加到自己的.bash_profile文件中去。

在安装完client后,应运行sqlplus连接Oracle数据库来验证一下client安装的正确与否。

三、安装PHP oci8 extension

还是以能够使用sudo的普通用户身份运行下面命令:

sudo apt-get install build-essential

sudo apt-get install php5-dev php-pear

sudo pecl install oci8

在下列提示后输入$ORACLE_HOME的实际路径(我自己的是/usr/lib/oracle/xe/app/oracle/product/10.2.0/client):

sail@ubuntu:~$ sudo pecl install oci8

downloading oci8-1.2.2.tgz ...

Starting to download oci8-1.2.2.tgz (71,806 bytes) .................done: 71,806 bytes

10 source files, building

running: phpize

Configuring for:

PHP Api Version: 20041225

Zend Module Api No: 20050922

Zend Extension Api No: 220051025

Please provide the path to ORACLE_HOME dir. Use 'instantclient,/path/to/instant/client/lib' if you're compiling against Oracle Instant Client [autodetect] :

在系统编译安装好以后,应该在/usr/lib/php5/20051025(我的php是5.1.6版本的)目录下有一个oci8.so文件。之后执行命令:

sudo vi /etc/php5/apache2/php.ini

在相应位置加上

extension=oci8.so

存盘退出后重启apache2

sudo /etc/init.d/apache2 restart

现在,我们的“老婆”就大功告成了!用浏览器来验证一下吧!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表