My Advanced Linux/Advanced Linux 2009. 7. 24. 11:52
php 5.2.x버전 이상에서는 [--with-oci8=]이라는 configure 옵션에는 있지만 먹히지 않는 기묘한 현상을 보인다.
결국 뒤져본 결과 참으로 허탈한 답변을 구할 수 있었다.
first read what i wrote about:
I'm telling not about oracle8, but about oracle9 and oracle10.
extension name is OCI8 , but it used for oracle from 8 to 10
NOT ONLY TO ORACLE 8 (!)
------------------------------------------------------------------------
[2007-08-28 11:14:58] [EMAIL PROTECTED]
We don't support Oracle 8 anymore. :)
------------------------------------------------------------------------
그래 뭐.. 버전이 업데이트가 많이 된 상황이니 지원을 안 할 수도 있겠지..
라고 생각하고 다음 코멘트를 봤다.
[10 May 8:05pm UTC] tony2001@php.net
Upgrade to newer Oracle version.
OTL ... 새걸로 업그레이드 해라. 말이 업그레이드지...
그게 맘대로 되는 것이더냐!
구글신의 힘을 빌어 뒤져 본 결과.
역시나 방법(편법)이 있었다!
오류내용)
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error:
`OCI_NLS_CHARSET_MAXBYTESZ' undeclared (first use in this function)
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error: (Each
undeclared identifier is reported only once
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error: for each
function it appears in.)
make: *** [ext/oci8/oci8_lob.lo] Error 1
해결법)
일단 php 5.2.x 버전의 압축을 풀고 그 디렉토리로 이동한다. 아래 파일을 수정해 준다.
# vi ext/oci8/oci8_lob.c
그리고 아래와 같이 되어 있는 줄을 찾는다.
▶수정 전(약 303번째줄)
=======================================
if (is_clob) {
PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection,connection->errcode);
return 1;
}
} else {
/* BLOBs don't have encoding, so bytes_per_char == 1
*/
}
=======================================
▶수정 후(색칠 된것을 추가)
=======================================
if (is_clob) {
#ifdef OCI_NLS_CHARSET_MAXBYTESZ
PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection,connection->errcode);
return 1;
}
#else
bytes_per_char = 4;
#endif
} else {
/* BLOBs don't have encoding, so bytes_per_char == 1
*/
}
=======================================
이후 configure , make, make install 을 하면 된다.
결국 뒤져본 결과 참으로 허탈한 답변을 구할 수 있었다.
first read what i wrote about:
I'm telling not about oracle8, but about oracle9 and oracle10.
extension name is OCI8 , but it used for oracle from 8 to 10
NOT ONLY TO ORACLE 8 (!)
------------------------------------------------------------------------
[2007-08-28 11:14:58] [EMAIL PROTECTED]
We don't support Oracle 8 anymore. :)
------------------------------------------------------------------------
그래 뭐.. 버전이 업데이트가 많이 된 상황이니 지원을 안 할 수도 있겠지..
라고 생각하고 다음 코멘트를 봤다.
[10 May 8:05pm UTC] tony2001@php.net
Upgrade to newer Oracle version.
OTL ... 새걸로 업그레이드 해라. 말이 업그레이드지...
그게 맘대로 되는 것이더냐!
구글신의 힘을 빌어 뒤져 본 결과.
역시나 방법(편법)이 있었다!
오류내용)
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error:
`OCI_NLS_CHARSET_MAXBYTESZ' undeclared (first use in this function)
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error: (Each
undeclared identifier is reported only once
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error: for each
function it appears in.)
make: *** [ext/oci8/oci8_lob.lo] Error 1
해결법)
일단 php 5.2.x 버전의 압축을 풀고 그 디렉토리로 이동한다. 아래 파일을 수정해 준다.
# vi ext/oci8/oci8_lob.c
그리고 아래와 같이 되어 있는 줄을 찾는다.
▶수정 전(약 303번째줄)
=======================================
if (is_clob) {
PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection,connection->errcode);
return 1;
}
} else {
/* BLOBs don't have encoding, so bytes_per_char == 1
*/
}
=======================================
▶수정 후(색칠 된것을 추가)
=======================================
if (is_clob) {
#ifdef OCI_NLS_CHARSET_MAXBYTESZ
PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err,connection->errcode TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection,connection->errcode);
return 1;
}
#else
bytes_per_char = 4;
#endif
} else {
/* BLOBs don't have encoding, so bytes_per_char == 1
*/
}
=======================================
이후 configure , make, make install 을 하면 된다.