0
点赞
收藏
分享

微信扫一扫

【Vegas原创】Apache2.2 + PHP5.3.2 + Oracle 10g配置

1,下载apache2.2 和 php5.3.2

 

2,安装apache。我装的是httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi,装的时候记得更改apache安装目录【这对后续更改apache配置文件的效率会更高】 以及端口。 默认的端口是80 。 如果装了iis,记得更改其他的端口。

 

3, 安装php5.3.2。我装的是php-5.3.2-Win32-VC6-x86.zip这个文件。解压到一个方便的目录下。我解压到了D:\php文件夹下。

 

4, 将“php.ini-developer”更名为“php.ini”。

 

5,修改php.ini:

1),extension_dir路径改为:D:\php\ext

​​

【Vegas原创】Apache2.2 + PHP5.3.2 + Oracle 10g配置_html

​​

2),查找oracle 的extension,将前面的分号去掉:

​​

【Vegas原创】Apache2.2 + PHP5.3.2 + Oracle 10g配置_apache_02

​​

 

6, 配置apache支持php。找到apache安装目录,conf文件夹下的httpd.conf文件,打开:

1)设置起始页:

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

 

2)配置php:在#LoadModule vhost_alias_module modules/mod_vhost_alias.so后,添加:

# For PHP 5 do something like this:
LoadModule php5_module "D:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm .html    
# configure the path to php.ini
PHPIniDir “D:/php/”

​​

【Vegas原创】Apache2.2 + PHP5.3.2 + Oracle 10g配置_php_03

​​

 

3)修改根目录(类似iis的站点根目录):

DocumentRoot 修改为:DocumentRoot "D:/htdocs"

​​

【Vegas原创】Apache2.2 + PHP5.3.2 + Oracle 10g配置_html_04

​​

Directory修改为:

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "D:/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # ​​​http://httpd.apache.org/docs/2.2/mod/core.html#options​​​
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

​​

【Vegas原创】Apache2.2 + PHP5.3.2 + Oracle 10g配置_html_05

​​

 

4)保存httpd.conf文件

 

7,在D:\htdocs 新建一个index.html,内容如下:

<html>

<body>

<?php

if ($c=OCILogon("nhi", "nhi", "hisdb"))   //如果连接成功

{

echo "Successfully connected to Oracle.\n";

query = 'select name,open_mode from v$database';  //查询,显示

stid = oci_parse($c, $query);

r = oci_execute($stid);

Fetch the results in an associative array

print '<table border="1">';

while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) {

<tr>';

foreach ($row as $item) {

<td>'.($item?htmlentities($item):' ').'</td>';

}

</tr>';

}

</table>';

ocilogoff($c);                               //关闭连接

}

else                                                //否则显示错误

{

$err = OCIError();

echo "Oracle Connect Error " .$err[text];

}

phpinfo();                                         //显示php信息

?>

</body>

</html>

8,打开​​http://localhost​​ ,查看:

​​

【Vegas原创】Apache2.2 + PHP5.3.2 + Oracle 10g配置_html_06

​​

举报

相关推荐

0 条评论