Impossible d'installer pdo_oci sur redhat7

Fermé
hamba14 - Modifié par hamba14 le 24/01/2017 à 11:29
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 - 7 févr. 2017 à 10:25
bonjour à tous.

J'essaie d'installer pdo_oci sur mon système redhat7 en suivant ce tuto http://shiki.me/blog/installing-pdo_oci-and-oci8-php-extensions-on-centos-6-4-64bit/ mais arrivé au niveau de make, on m'affiche l'erreur suivante que je n'arrive pas à résoudre:
php_pdo_oci_int.h:26:2: error: unknown type name 'sb4'
sb4 errcode;
Une assistance m'aiderai beaucoup.
Pour info j'ai oracle 12c installé et php 7 et la version de pdo_oci que j'ai téléchargée est PDO_OCI-1.0.

Merci d'avance pour l'aide.

8 réponses

mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 7 748
Modifié par mamiemando le 28/01/2017 à 13:02
Bonjour,

Il te manque vraisemblablement un header, j'imagine qu'avant cette erreur, tu en as eu d'autre. En théorie pour compiler ton programme tu es sensé lancer
./configure
au préalable pour t'assurer que tu as bien tout le nécessaire.

Je t'invite à d'abord voir si sous redhat tu n'as pas un paquet qui te permet d'installer directement ce que tu veux. On ne compile sur une machine un paquet qu'en dernier recours (i.e. quand il n'y a pas de paquets). Dit autrement, ce tutoriel me paraît bien compliqué, mais peut-être que tu n'as pas le choix.

S'il n'y a pas de paquet qui va bien, regarde si tu n'as rien oublié en confrontant ton tutoriel et celui-là :
https://ccm.net/faq/4987-linux-redhat-oracle-installing-pdo-oci-and-oci8-modules

Idéalement il faudrait trouver le header qui fournit ce type "sb4" mais je ne suis pas arrivé à le trouver (avec un nom pareil tu trouves beaucoup d'autres choses sur google), et installer le paquet qui le fournit.

Bonne chance
0
Bonjour mamiemando,

Merci pour l'assistance. Au fait j'ai utilisé la méthode du lien que tu as mis. avec l'installation du oci8 il n'y a pas d'erreur lors de l'installation mais quand j'utilise le oci_connect pour me connecter à une base de donnée, on m'affiche l'erreur suivante: Fatal error: Uncaught Error: Call to undefined function oci_connect().
Lorsque j'essaie d'installer le pdo_oci, au niveau du make && make install il m'affiche l'erreur suivante :

-fPIC -DPIC -o .libs/pdo_oci.o
In file included from /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] Erreur 1

Merci d'avance de l'assistance.
0
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 7 748
Modifié par mamiemando le 30/01/2017 à 16:55
Bonjour,

Pour le moment, ta compilation se passe mal, vraisemblablement parce que tu n'as pas installé au préalable toutes les librairies nécessaire à la compilation.

Je ne pas vraiment reproduire la démarche vu que je n'utilise pas la même distribution, mais je suspecte qu'au moment de lancer

#ln -s /usr/include/php5/ include/php

... le chemin n'était pas correct,
- soit parce que tu ne lances pas la commande depuis le bon répertoire
- soit parce que /usr/include/php5 ne contient pas de fichier oci.h.

1) Commence par localiser
oci.h
:

find /usr | grep "/oci.h$"


2) En C, quand on écrit <toto.h>, cela signifie que toto.h est dans un répertoire d'include spécifié au compilateur. Ces répertoires sont ceux explicité par l'option
-I
ou
-isystem
au moment de compiler.

Sous linux les répertoires
/usr/include
et
/usr/local/include
sont implicitement considérés (pas besoin de
-I/usr/include
donc).

Je suspecte qu'actuellement, ton programme est compilé avec l'option
-I ./include/php
, ce qui expliquerait pourquoi le tutoriel te demande de faire ce lien symbolique (
ln -s /usr/include/php5/ include/php
).

Si c'est bien ça, alors il faut que lorsque tu lances
ls ./include/php
depuis le répertoire dans lequel tu compiles, le fichier
oci.h
apparaisse. Sinon le lien symbolique est faux. La position dans laquelle se trouve
oci.h
peut nous aider à comprendre s'il y a une erreur dans ton tutoriel.

3) Tu peux aussi -I/usr/include/php si ton fichier se trouve être
/usr/include/php/oci.h
.

4) Pour plus de précisions, il faudrait que je vois ce qu'il y a dans
PDO_OCI-1.0.tgz
. Si tu peux mettre ce fichier en partage, je peux y jeter un œil.


Bonne chance
0
bonjour mamiemando ,

voici le contenu du répertoire PDO_OCI-1.0 après décompression:

CREDITS
php_pdo_oci.h
config.w32
oci_driver.c
config.m4
php_pdo_oci_int.h
oci_statement.c
pdo_oci.c

Merci d'avance
0
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 7 748
1 févr. 2017 à 10:30
Il faudrait que tu me donnes la réponse aux autres questions, pas seulement la question (4).
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Bonjour mamiemande,

1) /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/oci.h
2) quand je fais ls ./include/php j'ai bien le fichier oci.h dans la liste qui s'affiche comme tu peux le voir: 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

Merci pour la disponibilité.
0
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 7 748
Modifié par mamiemando le 5/02/2017 à 12:42
1) Donc voilà, ce n'est pas un répertoire standard et si tu ne précises pas au compilateur qu'il a une chance de trouver des headers dans
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/
, il ne les trouvera pas...

2) ... mais grâce à ce lien symbolique, ça devrait aller, à condition qu'il ait été établi depuis le bon répertoire. Est-ce que le
ls
a bien été fait dans le répertoire qui contient le
Makefile 
?

Si le problème persiste, relance
./configure
et copie colle moi le résultat.

Bonne chance
0
Bonsoir mamiemando,

En faisant le ./configure dans le répertoire PDO_OCI-1.0 voici ce qu'il m'affiche:

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

Et maintenant quand je fais make voici l'erreur et les warning qui s'affichent:

/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: (near initialization for 'pdo_oci_functions[0]') [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: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é.
0
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 7 748
7 févr. 2017 à 10:25
Ah ton message d'erreur a changé !

As-tu essayé ceci ?
https://stackoverflow.com/questions/20874536/pdo-oci-make-does-not-work

Bonne chance
0