php 连接oracle 无法 启用oci8 解决办法 (摘自oracle官网)

php中文网
发布: 2016-08-08 09:24:21
原创
1944人浏览过

enabling the php oci8 extension on windows

The Instant Client binaries complement PHP's pre-built binaries for Windows.

  1. Install Apache by downloading httpd-2.2.22-win32-x86-no_ssl.msi from httpd.apache.org/download.cgi

  2. Double click the MSI file to start the installation wizard.

    Install "for All Users, on Port 80". Do a typical install into the default destination folder: C:\Program Files\Apache Software Foundation\Apache2.2.

    立即学习PHP免费学习笔记(深入)”;

  3. Download the FastCGI component mod_fcgid-2.3.6-win32-x86.zip from httpd.apache.org/download.cgi#mod_fcgid

  4. Unzip it to the installed Apache 2.2 directory. The C:\Program Files\Apache Software Foundation\Apache2.2\modulesdirectory should now have mod_fcgid.so and mod_fcgid.pdb files.

  5. Edit C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf and add the line:

    LoadModule fcgid_module modules/mod_fcgid.so
    登录后复制
  6. In httpd.conf, locate the 

    section for htdocs and add ExecCGI to the Options:

    <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
    ...
    Options Indexes FollowSymLinks ExecCGI...
    </Directory>
    登录后复制
  7. Install PHP by downloading the PHP 5.4.0 "VC9 x86 Non Thread Safe" ZIP package php-5.4.0-nts-Win32-VC9-x86.zip fromwindows.php.net/download.

  8. In Windows Explorer unzip the PHP package to a directory called C:\php-5.4.0<br>

  9. In C:\php-5.4.0 copy php.ini-development to php.ini<br>

    法语写作助手
    法语写作助手

    法语助手旗下的AI智能写作平台,支持语法、拼写自动纠错,一键改写、润色你的法语作文。

    法语写作助手 31
    查看详情 法语写作助手
  10. Edit php.ini to make the following changes:

    • Add a timezone line like:

      date.timezone = America/Los_Angeles
      登录后复制


      Use your local timezone name.

    • Add the line:

      extension_dir = C:\php-5.4.0\ext
      登录后复制


      This is the directory containing the PHP extensions.

    • Remove the semicolon from the beginning of the line:

      extension=php_oci8_11g.dll
      登录后复制
  11. Edit C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf and add the following lines. Make sure you use forward slashes '/' and not back slashes '\':

    FcgidInitialEnv PHPRC "c:/php-5.4.0"
    AddHandler fcgid-script .php
    FcgidWrapper "c:/php-5.4.0/php-cgi.exe" .php
    登录后复制
  12. Download the "Instant Client Package - Basic" for Windows from the OTN Instant Client page. Because PHP is 32 bit, use the 32 bit version of Instant Client.

    Unzip the Instant Client files to C:\instantclient_11_2

  13. Edit the Windows PATH environment setting and add C:\instantclient_11_2. For example, on Windows XP, follow Start -> Control Panel -> System -> Advanced -> Environment Variables and edit PATH in the System variables list.

    Commonly you need to reboot Windows so the new environment is correctly set.

    Set desired Oracle globalization language environment variables such as NLS_LANG. If nothing is set, a default local environment will be assumed. See the Globalization chapter in The Underground PHP and Oracle Manual for more details.

    Unset Oracle variables such as ORACLE_HOME and ORACLE_SID, which are unnecessary with Instant Client.

    If you have other Oracle software on the computer then instead of modifying the Windows environment, write a script that sets these values and starts Apache. Otherwise library symbol clashes are likely because of version differences.

  14. Restart Apache using the system tray Apache Monitor or the Start menu option.

以上就介绍了php 连接oracle 无法 启用oci8 解决办法 (摘自oracle官网),包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号