Windows XP+Apache2.2+PHP5.3+OCI8 痛苦安装总结
2010-10-13 14:53
567 查看
Install Oracle Instance Client
STEP1:Download Oracle instance client from oracle web site. --->instantclient_11_2
STEP2:Unzip oracle instance client basc into D:/oracle/instantclient_11_2
STEP3:Add D:/oracle/instantclient_11_2 into the beginning of PATH environment variable.
Install Php oci8 DLL
STEP1:Download DLL from google search. (1.4 version)
STEP2:Copy PHP_OCI8.DLL into /php/ext directory
STEP3:Add extension=php_oci8.dll into php.ini
Restart Apache: fail
STEP1:Check error message in apache directory :logs/errors.log
error message:
Starting the Apache2.2 service
The Apache2.2 service is running.
] Apache/2.2.15 (Win32) PHP/5.3.2 configured -- resuming normal operations
[Wed Oct 13 10:06:37 2010] [notice] Server built: Mar 4 2010 11:27:46
[Wed Oct 13 10:06:37 2010] [notice] Parent: Created child process 3572
[Wed Oct 13 10:06:37 2010] [debug] mpm_winnt.c(487): Parent: Sent the scoreboard to the child
[Wed Oct 13 10:06:41 2010] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting.
[Wed Oct 13 10:06:41 2010] [notice] Parent: Forcing termination of child process 36
[Wed Oct 13 10:06:41 2010] [info] removed PID file D:/Program Files/Apache Software Foundation/Apache2.2/logs/httpd.pid (pid=2400)
STEP2:Google with "master_main: create child process failed.Exiting.", nothing find.
STEP3:Check PHP error log file php-errors.log
error message:
[13-Oct-2010 09:25:39] PHP Warning: PHP Startup: oci8: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
STEP4:Google with "PHP Warning: PHP Startup: oci8: Unable to initialize module"
And find out the oci8 dll version is not suitable, the version is lower than php 5.3 compiled version.
STEP5:Uninstall PHP 5.3.2 from pc, and download PHP 5.3.3 , and install it with all packages.
Restart Apache: successful
Test OCI8 connection:
STEP1: create test.php file under apache htdocs folder.
STEP2: write source code into test.php file:
<?php
echo "step1 ";
$linkstr="(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = X.X.X.X)(PORT = 1521)))
(CONNECT_DATA =(SERVICE_NAME = XXXX)))";
$conn = oci_connect('user', 'password', $linkstr);
echo "step2 ";
if (!$conn) {
echo "in step1";
trigger_error("Could not connect to database", E_USER_ERROR);
}else{
echo "tina";
}
echo "step3 ";
$SQL="select * from apt_l_spdopt";
echo "step4 ";
$stid = oci_parse($conn, $SQL);
echo "step5 ";
if (!$stid){
trigger_error("Could not parse sql:".$SQL, E_USER_ERROR);
}
echo "step6 ";
oci_execute($stid);
while (($row = oci_fetch_array ($stid, OCI_ASSOC))) { // Ignore NULLs
var_dump($row);
}
echo "step7 ";
oci_free_statement($stid);
oci_close($conn);
?>
STEP5: View test.php with localhost:86/test.php, failed with message(php_errors.log)---->
[13-Oct-2010 03:38:43] PHP Warning: Module 'oci8' already loaded in Unknown on line 0
STEP6:Google with error message, and find that there are two oci8 dll exist in php.ini (php_oci8.dll &php_oci8_11g.dll),
STEP7:Uncomment php_oci8.dll, and refresh test.php. failed with message(php_errors.log)----->
[13-Oct-2010 05:13:48] PHP Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in D:/Projects/PHP/APTUpload/jobs/include/libOracle.php on line 44
[13-Oct-2010 05:13:48] PHP Warning: oci_parse() expects parameter 1 to be resource, boolean given in D:/Projects/PHP/APTUpload/jobs/include/libOracle.php on line 198
STEP8:Google with "oci_connect(): OCIEnvNlsCreate() failed", and find out that system cannot find dll library,
STEP9:Copy oci.dll,orannzsbb11.dll,oraociei11.dll,ociw32.dll into C:/WINDOWS/system32 folder, and make sure that mfc71.dll,msvcr71.dll exist in C:/WINDOWS/system32 folder.
Restart Apache : successful
Retest test.php : failed
STEP1:Check php_errors.log, error message--->
[13-Oct-2010 06:11:39] PHP Warning: oci_connect(): ORA-12705: Cannot access NLS data files or invalid environment specified in D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/test.php on line 6
STEP2:注册表里 /HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE 查找键 NLS_LANG,这个键由Oracle标准客户端安装创建, 值是 NA 。这个导致了 ORA-12705错误。解决方法就是修改NA为SIMPLIFIED CHINESE_CHINA.ZHS16GBK。
STEP3:refresh test.php, successfule
The whole process spend two days! it is a very good experience.
STEP1:Download Oracle instance client from oracle web site. --->instantclient_11_2
STEP2:Unzip oracle instance client basc into D:/oracle/instantclient_11_2
STEP3:Add D:/oracle/instantclient_11_2 into the beginning of PATH environment variable.
Install Php oci8 DLL
STEP1:Download DLL from google search. (1.4 version)
STEP2:Copy PHP_OCI8.DLL into /php/ext directory
STEP3:Add extension=php_oci8.dll into php.ini
Restart Apache: fail
STEP1:Check error message in apache directory :logs/errors.log
error message:
Starting the Apache2.2 service
The Apache2.2 service is running.
] Apache/2.2.15 (Win32) PHP/5.3.2 configured -- resuming normal operations
[Wed Oct 13 10:06:37 2010] [notice] Server built: Mar 4 2010 11:27:46
[Wed Oct 13 10:06:37 2010] [notice] Parent: Created child process 3572
[Wed Oct 13 10:06:37 2010] [debug] mpm_winnt.c(487): Parent: Sent the scoreboard to the child
[Wed Oct 13 10:06:41 2010] [crit] (OS 6)The handle is invalid. : master_main: create child process failed. Exiting.
[Wed Oct 13 10:06:41 2010] [notice] Parent: Forcing termination of child process 36
[Wed Oct 13 10:06:41 2010] [info] removed PID file D:/Program Files/Apache Software Foundation/Apache2.2/logs/httpd.pid (pid=2400)
STEP2:Google with "master_main: create child process failed.Exiting.", nothing find.
STEP3:Check PHP error log file php-errors.log
error message:
[13-Oct-2010 09:25:39] PHP Warning: PHP Startup: oci8: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
STEP4:Google with "PHP Warning: PHP Startup: oci8: Unable to initialize module"
And find out the oci8 dll version is not suitable, the version is lower than php 5.3 compiled version.
STEP5:Uninstall PHP 5.3.2 from pc, and download PHP 5.3.3 , and install it with all packages.
Restart Apache: successful
Test OCI8 connection:
STEP1: create test.php file under apache htdocs folder.
STEP2: write source code into test.php file:
<?php
echo "step1 ";
$linkstr="(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = X.X.X.X)(PORT = 1521)))
(CONNECT_DATA =(SERVICE_NAME = XXXX)))";
$conn = oci_connect('user', 'password', $linkstr);
echo "step2 ";
if (!$conn) {
echo "in step1";
trigger_error("Could not connect to database", E_USER_ERROR);
}else{
echo "tina";
}
echo "step3 ";
$SQL="select * from apt_l_spdopt";
echo "step4 ";
$stid = oci_parse($conn, $SQL);
echo "step5 ";
if (!$stid){
trigger_error("Could not parse sql:".$SQL, E_USER_ERROR);
}
echo "step6 ";
oci_execute($stid);
while (($row = oci_fetch_array ($stid, OCI_ASSOC))) { // Ignore NULLs
var_dump($row);
}
echo "step7 ";
oci_free_statement($stid);
oci_close($conn);
?>
STEP5: View test.php with localhost:86/test.php, failed with message(php_errors.log)---->
[13-Oct-2010 03:38:43] PHP Warning: Module 'oci8' already loaded in Unknown on line 0
STEP6:Google with error message, and find that there are two oci8 dll exist in php.ini (php_oci8.dll &php_oci8_11g.dll),
STEP7:Uncomment php_oci8.dll, and refresh test.php. failed with message(php_errors.log)----->
[13-Oct-2010 05:13:48] PHP Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in D:/Projects/PHP/APTUpload/jobs/include/libOracle.php on line 44
[13-Oct-2010 05:13:48] PHP Warning: oci_parse() expects parameter 1 to be resource, boolean given in D:/Projects/PHP/APTUpload/jobs/include/libOracle.php on line 198
STEP8:Google with "oci_connect(): OCIEnvNlsCreate() failed", and find out that system cannot find dll library,
STEP9:Copy oci.dll,orannzsbb11.dll,oraociei11.dll,ociw32.dll into C:/WINDOWS/system32 folder, and make sure that mfc71.dll,msvcr71.dll exist in C:/WINDOWS/system32 folder.
Restart Apache : successful
Retest test.php : failed
STEP1:Check php_errors.log, error message--->
[13-Oct-2010 06:11:39] PHP Warning: oci_connect(): ORA-12705: Cannot access NLS data files or invalid environment specified in D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/test.php on line 6
STEP2:注册表里 /HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE 查找键 NLS_LANG,这个键由Oracle标准客户端安装创建, 值是 NA 。这个导致了 ORA-12705错误。解决方法就是修改NA为SIMPLIFIED CHINESE_CHINA.ZHS16GBK。
STEP3:refresh test.php, successfule
The whole process spend two days! it is a very good experience.
相关文章推荐
- windows下安装apache2.2+svn总结
- Windows系统上使用Apache2.2上模块化安装PHP5.3
- windows 7下安装Apache 2.2
- windows 7 , apache 2.2 安装xsendfile 模块 的方法
- xp下安装SVN和Apache2.2
- Windows 安装Apache2.2和Mongrel运行Ruby on Rails
- Windows 环境下Apache HTTP Server 2.2的安装和使用apache转发weblogic集群
- 在windows上安装apache2.2 + php 5.2.5 + mysql 5.0
- windows下php5 apache2.2 mysql5 配置中的问题总结
- windows下安装apache2.2 + python2.7 + django(mod_wsgi集成)
- WIndows 环境下安装php环境(php5.2.9+apache2.2安装过程)
- apache2.2和php5.4.2在windows下的安装
- 如何在windows XP下安装基于apache或者IIS的bugzilla
- centOS6.8编译安装Apache 2.2+Mysql5.5+Php5.3
- windowsxp+apache+mysql+php安装方法
- windows下安装apache2.2 + python2.7 + django---------(1)
- 【转】给Windows + Apache 2.2 + PHP 5.3 安装PHP性能测试工具 xhprof
- Apache2.2+MySql5.5+PHP5.4的安装和配置(windows)
- php和apache和mysql配置 Windows XP + Apache 2.2.4 + PHP 5.2.3 + MySQL 5.0.27 + Zend Optimizer 3.3.0环境配置说明(推荐)
- Apache2.2+MySql5.5+PHP5.4的安装和配置(windows)