[résolu] Compilation php-5.2.1

Bonjour,
je sais pas si je poste dans la bonne section, veuillez m’excuser.

Voilà je suis sous debian sarge et j’essais d’installer php-5.2.1 par les sources.
Mais j’ai une erreur de compilation alors que la configuration passe sans problème.
Voici mes options pour le ./configure:

et voici l’erreur à la fin de la compilation avec make:

ext/iconv/iconv.o(.text+0x311): In function `_php_iconv_appendl': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x43e): In function `_php_iconv_appendl': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x506): In function `php_iconv_string': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x557): In function `php_iconv_string': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x5c6): In function `php_iconv_string': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x60e): In function `php_iconv_string': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x643): In function `_php_iconv_strlen': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x6bf): In function `_php_iconv_strlen': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x6fc): In function `_php_iconv_strlen': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x7d8): In function `_php_iconv_substr': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x861): In function `_php_iconv_substr': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x891): In function `_php_iconv_substr': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x935): In function `_php_iconv_substr': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x946): In function `_php_iconv_substr': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x9ce): In function `_php_iconv_strpos': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0xa4e): In function `_php_iconv_strpos': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0xc7d): In function `_php_iconv_strpos': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0xd0f): In function `_php_iconv_mime_encode': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0xd36): In function `_php_iconv_mime_encode': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x15ab): In function `_php_iconv_mime_encode': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x15f5): In function `_php_iconv_mime_encode': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x1637): In function `_php_iconv_mime_encode': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x1b04): In function `_php_iconv_mime_encode': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x1b4c): In function `_php_iconv_mime_encode': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x2110): more undefined references to `libiconv' follow ext/iconv/iconv.o(.text+0x214f): In function `_php_iconv_mime_encode': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x2160): In function `_php_iconv_mime_encode': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x21ff): In function `_php_iconv_mime_decode': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x248c): In function `_php_iconv_mime_decode': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x24a1): In function `_php_iconv_mime_decode': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x2d37): In function `_php_iconv_mime_decode': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x2d48): In function `_php_iconv_mime_decode': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x428f): In function `php_iconv_stream_filter_dtor': : undefined reference to `libiconv_close' ext/iconv/iconv.o(.text+0x4411): In function `php_iconv_stream_filter_ctor': : undefined reference to `libiconv_open' ext/iconv/iconv.o(.text+0x4563): In function `php_iconv_stream_filter_append_bucket': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x4612): In function `php_iconv_stream_filter_append_bucket': : undefined reference to `libiconv' ext/iconv/iconv.o(.text+0x4642): In function `php_iconv_stream_filter_append_bucket': : undefined reference to `libiconv' collect2: ld returned 1 exit status make: *** [sapi/cgi/php] Erreur 1

J’ai chercher sur google en tappant l’erreur mais je n’ai pas les infos que je veux.
j’ai essayer de faire un lien symbolique vers le dossier des libraries linux mais rien n’y fait.
libiconv.so se trouve bien dans /usr/local/lib/
Je suis bloqué.

Note: je n’ai pas fait un apt-get install libapache2-mod-php5 car je n’ai pas les options que je veux.

Merci de m’aider.

Il ne te faut pas libiconv.so mais libiconv.a pour la compilation/edition de lien…

merci pour ta réponse.
Mais alors je fais comment ?

Ton fichier libiconv.so vient bien de quelque part, mettons du paquet libiconv, installe libiconv-dev. Utilise «dpkg -S» pour voir d’où il vient.
Sinon, installe libiconv-hook-dev peut être

Le problème c que le packet libiconv-dev n’existe pas et il est maintenant inclus dans libc6-dev.
libiconv-hook-dev est déjà installé.
J’ai trouver une autre solution c de compiler avec --without-iconv tant pis s’il manque des fonctions.
Merci pour ton aide.

et un locate libiconv.a ne te donne rien? ou un find? l’objectif est de trouvé le fichier et de le passer en parametre au compilateur pour qu’il sache ou le trouver

En fait,
la bibliothèque libiconv est déjà compilée et installée.
Donc normalement le .a c transformé en .so si j’dit pas d’conneries… :unamused:
A moins d’avoir zappé un truc.
En fait, php va voir dans son dossier ext/ et il compile le dossier iconv pendant la compilation générale je vais dire.
Et je sais pas pourquoi il va regarder si j’ai un autre libiconv dans les parages et ça ça fou la merde.

Car si je fais un find /usr -name libiconv*
Il me trouve /usr/local/lib/libiconv.so

J’ai implicitement indiquer dans les options de configuration que je voulais le libiconv.so qui se trouve à cet endroit par un --with-iconv-dir=/usr/local
Et bang il me met une erreur comme quoi il ne le trouve pas ou alors il trouve pas celui qu’il veut.

Je voudrais ajouter un truc aussi:
Il me font rires les développeurs de chez php, leur travail est impeccable ya pas à dire mais pour le suivit des erreurs c’est une autre histoire.

Tu as 4 choix,

  • soit installer par apt-get sur debian et là tu te casses pas trop la nénètte mais ta pas les options que tu veux (attention, j’ai pas dit qu’il fallait pas installer par apt-get non plus car ça m’a sauver la vie plus d’une fois, surtout pour les dépendances c’est un outil fantastique)

  • Soit tu tappe l’erreur dans google en espérant que tu ais de la chance et un bon esprit de déduction.

  • Soit tu vas voir dans les mailing-list de php et là tu dois te lever à 6 h du mat, à 12h ta trouver un truc mais c pas ça et à 18h tu à enfin trouver quelque chose qui se rapproche en espérant que ça soit ça mais c en anglais pfff.

  • Soit tu te suicide à la cafféine et tu recommence
    Mais ça tu vas me dire… c’est l’informatique…normal quoi.

  • Il y a une 5 ème options aussi c de désactiver le libiconv par --without-iconv et là ça passe mais c pas non plus ce qu’on veut :confused:
    Ils peuvent pas regrouper les erreurs principales dans une faq car on retrouve souvent les mêmes erreurs à la compil de php.
    (c juste un p’tit coup de gueule mais c rien ça va passer…)

Non, le .so ce sont les binaires. Le fichier .a est nécessaire pour l’édition de lien. Le problème est de savoir pourquoi on ne peut pas avoir cette librairie sous debian, personnellement, j’aurais fait pris les source debian et remplacé le paquet original par ton paquet php5.

fran.b, le paquet je le trouve pas.
@ ashgenesis : le locate libiconv.a ne donne rien.

Donc voilà,
J’ai récupérer les sources de libc6-dev et en décompressant le glibc-2.3.2.tar.bz2 je vois le dossier iconv.
J’ai fait un cp -R iconv vers les sources et le dossier ext de php.

J’ai refait une compilation et:

In file included from /usr/local/src/php-5.2.1/ext/iconv/iconv.c:26: ext/iconv/gconv_int.h:37: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:37: warning: data definition has no type or storage class ext/iconv/gconv_int.h:39: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:39: warning: data definition has no type or storage class ext/iconv/gconv_int.h:118: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:118: warning: data definition has no type or storage class ext/iconv/gconv_int.h:122: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:122: warning: data definition has no type or storage class ext/iconv/gconv_int.h:125: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:125: warning: data definition has no type or storage class ext/iconv/gconv_int.h:164: error: syntax error before "internal_function" ext/iconv/gconv_int.h:164: warning: data definition has no type or storage class ext/iconv/gconv_int.h:168: error: syntax error before "internal_function" ext/iconv/gconv_int.h:168: warning: data definition has no type or storage class ext/iconv/gconv_int.h:177: error: syntax error before "internal_function" ext/iconv/gconv_int.h:177: warning: data definition has no type or storage class ext/iconv/gconv_int.h:184: error: syntax error before "internal_function" ext/iconv/gconv_int.h:184: warning: data definition has no type or storage class ext/iconv/gconv_int.h:190: error: syntax error before "internal_function" ext/iconv/gconv_int.h:190: warning: data definition has no type or storage class ext/iconv/gconv_int.h:196: error: syntax error before "internal_function" ext/iconv/gconv_int.h:196: warning: data definition has no type or storage class ext/iconv/gconv_int.h:200: error: syntax error before "internal_function" ext/iconv/gconv_int.h:200: warning: data definition has no type or storage class ext/iconv/gconv_int.h:203: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:203: warning: data definition has no type or storage class ext/iconv/gconv_int.h:206: error: syntax error before "internal_function" ext/iconv/gconv_int.h:206: warning: data definition has no type or storage class ext/iconv/gconv_int.h:218: error: syntax error before "internal_function" ext/iconv/gconv_int.h:218: warning: data definition has no type or storage class ext/iconv/gconv_int.h:222: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:222: warning: data definition has no type or storage class ext/iconv/gconv_int.h:228: error: syntax error before "internal_function" ext/iconv/gconv_int.h:228: warning: data definition has no type or storage class ext/iconv/gconv_int.h:233: error: syntax error before "internal_function" ext/iconv/gconv_int.h:233: warning: data definition has no type or storage class ext/iconv/gconv_int.h:238: error: syntax error before "internal_function" ext/iconv/gconv_int.h:238: warning: data definition has no type or storage class ext/iconv/gconv_int.h:243: error: syntax error before "internal_function" ext/iconv/gconv_int.h:243: warning: data definition has no type or storage class ext/iconv/gconv_int.h:248: error: syntax error before "internal_function" ext/iconv/gconv_int.h:248: warning: data definition has no type or storage class ext/iconv/gconv_int.h:252: error: syntax error before "internal_function" ext/iconv/gconv_int.h:252: warning: data definition has no type or storage class ext/iconv/gconv_int.h:262: error: syntax error before "attribute_hidden" ext/iconv/gconv_int.h:262: warning: data definition has no type or storage class make: *** [ext/iconv/iconv.lo] Erreur 1

je sèche… :cry:

J’ai trouvé la réponse ici:
bugs.php.net/rss/bug.php?id=31193&format=rss

Il faut ajouter “-liconv” à la ligne 97 du Makefile de php
Et faire le make.

Merci…à vous deux de vous être pencher sur le problème.
Merci a vous deux pour votre aide je marque le thread en résolu.

  1. Tu fais

apt-get build-dep php5

  1. tu vas ci dessous

http://packages.debian.org/unstable/web/php5

Tu charges les fichiers dsc et diff.gz puis tu peux essayer la démarche que j’ai expliquée là (le paragraphe 4) http://forum.debian-fr.org/viewtopic.php?t=4691

En clair, tu peux déplier tes sources, tu renommes le répertoire en

php-5.2.0-8

Tu fais

$ cd php-5.2.0-8
$ zcat …/php5_5.2.0-8.diff.gz | patch -p1
$ dch -v 5.2.1
$ fakeroot dpkg-buildpackage -us -uc

et là tu pars pour la compilation du paquet.