• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 4年前 (2022-01-23) 35次浏览 已收录 0个评论

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.

  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:

    ...Options Indexes FollowSymLinks ExecCGI...
  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

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

  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 .phpFcgidWrapper "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 来&源gao@dai!ma.com搞$代^码%网搞gaodaima代码-> 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教程有兴趣的朋友有所帮助。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php 连接oracle 无法 启用oci8 解决办法 (摘自oracle官网)

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址