zoukankan      html  css  js  c++  java
  • 【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

    image

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

    image

    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/”

    image

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

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

    image

    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>

    image

    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 '&lt;table border="1">';
            while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) {
               print '<tr>';
               foreach ($row as $item) {
                  print '<td>'.($item?htmlentities($item):' ').'</td>';
               }
               print '</tr>';
            }
            print '</table>';
       
            ocilogoff($c);                               //关闭连接
        } 
    else                                                //否则显示错误       
        { 
            $err = OCIError();
            echo "Oracle Connect Error " .$err[text];
        }
     
    phpinfo();                                         //显示php信息
     
    ?>
     
    </body>
    </html>

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

    image

    喜欢请赞赏一下啦^_^
  • 相关阅读:
    C语言printf()输出格式大全
    C语言ASCII码、运算符优先级、转义字符
    通过Navicat for MySQL远程连接的时候报错mysql 1130 的解决方法
    mysql kill process解决死锁
    常用的二种修改mysql最大连接数的方法
    show processlist结果筛选
    数据库连接driverClass和jdbcUrl大全
    在实例中引用模式文档
    在Eclipse中导入dtd和xsd文件,使XML自动提示
    Linux下Java安装与配置
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744151.html
Copyright © 2011-2022 走看看