Imposible instalar pdo_oci en redhat7
hola a todos.
Estoy intentando instalar pdo_oci en mi sistema redhat7 siguiendo este tutorial http://shiki.me/blog/installing-pdo_oci-and-oci8-php-extensions-on-centos-6-4-64bit/ pero al llegar a la etapa de make, me aparece el siguiente error que no puedo resolver:
php_pdo_oci_int.h:26:2: error: unknown type name 'sb4'
sb4 errcode;
Una ayuda me vendría muy bien.
Para info tengo Oracle 12c instalado y PHP 7 y la versión de pdo_oci que descargué es PDO_OCI-1.0.
Gracias de antemano por la ayuda.
Estoy intentando instalar pdo_oci en mi sistema redhat7 siguiendo este tutorial http://shiki.me/blog/installing-pdo_oci-and-oci8-php-extensions-on-centos-6-4-64bit/ pero al llegar a la etapa de make, me aparece el siguiente error que no puedo resolver:
php_pdo_oci_int.h:26:2: error: unknown type name 'sb4'
sb4 errcode;
Una ayuda me vendría muy bien.
Para info tengo Oracle 12c instalado y PHP 7 y la versión de pdo_oci que descargué es PDO_OCI-1.0.
Gracias de antemano por la ayuda.
8 respuestas
-
Hola,
Probablemente te falte un header; supongo que antes de este error tuviste otros. En teoría, para compilar tu programa, deberías ejecutar primero ./configure para asegurarte de que tienes todo lo necesario.
Te invito a primero verificar si bajo Red Hat no tienes un paquete que te permita instalar directamente lo que quieres. Solo se compila un paquete en una máquina como último recurso (es decir, cuando no hay paquetes). Dicho de otra forma, este tutorial me parece bastante complicado, pero tal vez no tengas opción.
Si no existe un paquete que funcione, revisa si no has olvidado algo comparando tu tutorial con éste:
https://ccm.net/faq/4987-linux-redhat-oracle-installing-pdo-oci-and-oci8-modules
Ideablemente deberías encontrar el header que provee este tipo "sb4" pero no he logrado encontrarlo (con un nombre así se encuentran muchas otras cosas en Google), e instalar el paquete que lo proporciona.
Bonne chance -
Hola mamiemando,
Gracias por la ayuda. A propósito, he utilizado el método del enlace que pusiste. con la instalación de oci8 no hay error durante la instalación pero cuando uso oci_connect para conectarme a una base de datos, me aparece el siguiente error: Fatal error: Uncaught Error: Call to undefined function oci_connect(). Cuando intento instalar el pdo_oci, a nivel de make && make install me aparece el siguiente error:
-fPIC -DPIC -o .libs/pdo_oci.o
En archivo incluido desde /home/oracle/PDO_OCI-1.0/pdo_oci.c:31:0:
/home/oracle/PDO_OCI-1.0/php_pdo_oci_int.h:21:17: fatal error: oci.h: No such file or directory
#include <oci.h>
^
compilation terminated.
make: *** [pdo_oci.lo] Error 1
Gracias de antemano por la ayuda.</oci.h> -
Hola,
Por el momento, tu compilación va mal, probablemente porque no has instalado previamente todas las librerías necesarias para la compilación.
No puedo reproducir exactamente el procedimiento ya que no uso la misma distribución, pero sospecho que al ejecutar
#ln -s /usr/include/php5/ include/php
... la ruta no era correcta,
- ya sea porque no ejecutaste el comando desde el directorio correcto
- o porque /usr/include/php5 no contiene oci.h.
1) Comienza por localizaroci.h
:find /usr | grep "/oci.h$"
2) En C, cuando escribimos <toto.h>, significa que toto.h está en un directorio de include especificado al compilador. Estos directorios son los que indica la opción-I
o-isystem
al momento de compilar.
En Linux, los directorios/usr/include
y/usr/local/include
se consideran implícitamente (no hace falta-I/usr/include
por lo tanto).
Sospecho que actualmente, tu programa se está compilando con la opción-I ./include/php
, lo que explicaría por qué el tutorial te pide hacer este enlace simbólico (ln -s /usr/include/php5/ include/php
).
Si es así, entonces cuando lancesls ./include/php
desde el directorio en el que compilas, debería aparecer el archivooci.h
. Si no, el enlace simbólico es incorrecto. La ubicación deoci.h
puede ayudarnos a entender si hay un error en tu tutorial.
3) También puedes usar -I/usr/include/php si tu archivo resulta ser/usr/include/php/oci.h
.
4) Para más precisión, sería bueno ver qué hay enPDO_OCI-1.0.tgz
. Si puedes compartir ese archivo, puedo echarle un vistazo.
Buena suerte -
hola mamiemando ,
aquí está el contenido del directorio PDO_OCI-1.0 tras la descompresión:
CREDITS
php_pdo_oci.h
config.w32
oci_driver.c
config.m4
php_pdo_oci_int.h
oci_statement.c
pdo_oci.c
Gracias de antemano -
Hola, mamá, te pido,
1) /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/oci.h
2) cuando hago ls ./include/php veo bien que el archivo oci.h está en la lista que se muestra como puedes ver: nzerror.h occiAQ.h occiControl.h occi.h oci1.h ociap.h ocidef.h ocidfn.h oci.h ocixmldb.h oratypes.h ori.h oro.h xa.h
nzt.h occiCommon.h occiData.h occiObjects.h oci8dp.h ociapr.h ocidem.h ociextp.h ocikpr.h odci.h orid.h orl.h ort.h
Gracias por la disponibilidad. -
1) Así que bueno, no es un directorio estándar y si no le indicas al compilador que tiene la posibilidad de encontrar encabezados en
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/
, no los encontrará...
2) ... pero gracias a este enlace simbólico, debería funcionar, siempre que se haya establecido desde el directorio correcto. ¿Se ejecutó ells
en el directorio que contiene elMakefile
?
Si el problema persiste, vuelve a ejecutar./configure
y cópiame el resultado.
Buena suerte -
Buenas noches mamiemando,
Al hacer ./configure en el directorio PDO_OCI-1.0, esto es lo que me muestra:
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking Oracle OCI support for PDO... yes, shared
checking Oracle Install-Dir... /u01/app/oracle/product/12.1.0/db_1 :yes:
checking if that is sane... yes
checking Oracle version... 10.1
checking for OCIEnvCreate in -lclntsh... yes
checking for OCIEnvNlsCreate in -lclntsh... yes
checking for OCILobIsTemporary in -lclntsh... yes
checking for OCICollAssign in -lclntsh... yes
checking for OCIStmtFetch2 in -lclntsh... yes
checking for PDO includes... checking for PDO includes... /usr/include/php/ext
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
Y ahora cuando hago make aparece el error y los warnings:
/bin/sh /home/oracle/PDO_OCI-1.0/libtool --mode=compile cc -I -I. -I/home/oracle/PDO_OCI-1.0 -DPHP_ATOM_INC -I/home/oracle/PDO_OCI-1.0/include -I/home/oracle/PDO_OCI-1.0/main -I/home/oracle/PDO_OCI-1.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/u01/app/oracle/product/12.1.0/db_1/rdbms/public -I/u01/app/oracle/product/12.1.0/db_1/rdbms/demo -DHAVE_CONFIG_H -g -O2 -c /home/oracle/PDO_OCI-1.0/pdo_oci.c -o pdo_oci.lo
libtool: compile: cc -I -I. -I/home/oracle/PDO_OCI-1.0 -DPHP_ATOM_INC -I/home/oracle/PDO_OCI-1.0/include -I/home/oracle/PDO_OCI-1.0/main -I/home/oracle/PDO_OCI-1.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/u01/app/oracle/product/12.1.0/db_1/rdbms/public -I/u01/app/oracle/product/12.1.0/db_1/rdbms/demo -DHAVE_CONFIG_H -g -O2 -c /home/oracle/PDO_OCI-1.0/pdo_oci.c -fPIC -DPIC -o .libs/pdo_oci.o
/home/oracle/PDO_OCI-1.0/pdo_oci.c:34:1: error: unknown type name 'function_entry'
function_entry pdo_oci_functions[] = {
^
/home/oracle/PDO_OCI-1.0/pdo_oci.c:35:2: warning: braces around scalar initializer [enabled by default]
{NULL, NULL, NULL}
^
/home/oracle/PDO_OCI-1.0/pdo_oci.c:35:2: warning: (near initialization for 'pdo_oci_functions[0]') [enabled by default]
^
/home/oracle/PDO_OCI-1.0/pdo_oci.c:35:2: warning: initialization makes integer from pointer without a cast [enabled by default]
^
/home/oracle/PDO_OCI-1.0/pdo_oci.c:35:2: warning: excess elements in scalar initializer [enabled by default]
^
/home/oracle/PDO_OCI-1.0/pdo_oci.c:35:2: warning: (near initialization for 'pdo_oci_functions[0]') [enabled by default]
^
/home/oracle/PDO_OCI-1.0/pdo_oci.c:56:2: warning: initialization from incompatible pointer type [enabled by default]
pdo_oci_functions,
^
/home/oracle/PDO_OCI-1.0/pdo_oci.c:56:2: warning: (near initialization for 'pdo_oci_module_entry.functions') [enabled by default]
make: *** [pdo_oci.lo] Erreur 1
Cordialement!
Merci pour la disponibilité. -
Ah, tu mensaje de error ha cambiado. ¡¿Lo has intentado esto?!
https://stackoverflow.com/questions/20874536/pdo-oci-make-does-not-work
Buena suerte