Ubuntu 10.04, PHP 5.3 et Oracle
Bonjour à tous :P
J'essaye un peu desespérément de re installer oracle après une mise à jour de Ubuntu 9.10 vers la 10.04, qui m'a changé la version de PHP et donc perdu toutes mes configs / installs.
Je suis ce tutoriel : http://www.lacot.org/blog/2009/11/03...t-install.html , mais ça plante au make de PDO-1.0.3. J'ai un autre PC sous Ubuntu 9.10, et ça marche.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| /bin/bash /home/steevanb/PDO-1.0.3/libtool --mode=compile cc -I. -I/home/steevanb/PDO-1.0.3 -DPHP_ATOM_INC -I/home/steevanb/PDO-1.0.3/include -I/home/steevanb/PDO-1.0.3/main -I/home/steevanb/PDO-1.0.3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/steevanb/PDO-1.0.3/pdo_dbh.c -o pdo_dbh.lo
libtool: compile: cc -I. -I/home/steevanb/PDO-1.0.3 -DPHP_ATOM_INC -I/home/steevanb/PDO-1.0.3/include -I/home/steevanb/PDO-1.0.3/main -I/home/steevanb/PDO-1.0.3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /home/steevanb/PDO-1.0.3/pdo_dbh.c -fPIC -DPIC -o .libs/pdo_dbh.o
/home/steevanb/PDO-1.0.3/pdo_dbh.c: In function pdo_stmt_instantiate:
/home/steevanb/PDO-1.0.3/pdo_dbh.c:410: error: zval has no member named refcount
/home/steevanb/PDO-1.0.3/pdo_dbh.c:411: error: zval has no member named is_ref
/home/steevanb/PDO-1.0.3/pdo_dbh.c: In function pdo_stmt_construct:
/home/steevanb/PDO-1.0.3/pdo_dbh.c:435: error: zend_fcall_info has no member named object_pp
/home/steevanb/PDO-1.0.3/pdo_dbh.c:458: error: zend_fcall_info_cache has no member named object_pp
/home/steevanb/PDO-1.0.3/pdo_dbh.c: In function zim_PDO_setAttribute:
/home/steevanb/PDO-1.0.3/pdo_dbh.c:752: error: zval has no member named refcount
/home/steevanb/PDO-1.0.3/pdo_dbh.c: In function zim_PDO_getAttribute:
/home/steevanb/PDO-1.0.3/pdo_dbh.c:818: error: zval has no member named refcount
/home/steevanb/PDO-1.0.3/pdo_dbh.c: In function pdo_hash_methods:
/home/steevanb/PDO-1.0.3/pdo_dbh.c:1122: warning: assignment discards qualifiers from pointer target type
/home/steevanb/PDO-1.0.3/pdo_dbh.c:1126: warning: assignment discards qualifiers from pointer target type |
Je suis complètement bloqué, je ne sais pas quoi faire. Quelqu'un a une idée pour corriger ce problème, une autre méthode pour installer oci, ou les versions déja compilées de PDO, oci et pdo_oci ?
Merci :cry:
Installation d'Oracle Instant Client 11g pour PHP 5.3 sous Ubuntu 10.04 avec support PDO
Il peut rester qq bogues dans la procédure car j'ai un peu gratté avant d'y arriver...
Note: on peut remplacer les 'sudo vi' par des 'gksudo gedit' pour plus de confort d'édition de fichiers texte ...
1. Installer libaio1 (prérequis Oracle 11g).
Code:
sudo apt-get install libaio1
2. Installer alien:
Code:
sudo apt-get install alien
3. Télécharger les RPMs ici: http://www.oracle.com/technetwork/da...ex-097480.html Prendre les fichiers RPM Basic, Devel et SqlPlus pour votre architecture.
4. Convertir les RPMs en .deb avec alien (ignorer l'erreur alien qui peut se produire):
Code (i386):
Code:
1 2 3
| sudo alien oracle-instantclient11.2-basic-11.2.0.1.0-1.i386.rpm
sudo alien oracle-instantclient11.2-devel-11.2.0.1.0-1.i386.rpm
sudo alien oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.i386.rpm |
Code (x64):
Code:
1 2 3
| sudo alien oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm
sudo alien oracle-instantclient11.2-devel-11.2.0.1.0-1.x86_64.rpm
sudo alien oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.x86_64.rpm |
5. Installer les paquets debian:
Code (i386):
Code:
1 2 3
| sudo dpkg -i oracle-instantclient11.2-basic_11.2.0.1.0-2_i386.deb
sudo dpkg -i oracle-instantclient11.2-devel_11.2.0.1.0-2_i386.deb
sudo dpkg -i oracle-instantclient11.2-sqlplus_11.2.0.1.0-2_i386.deb |
Code (x64):
Code:
1 2 3
| sudo dpkg -i oracle-instantclient11.2-basic_11.2.0.1.0-2_x86_64.deb
sudo dpkg -i oracle-instantclient11.2-devel_11.2.0.1.0-2_x86_64.deb
sudo dpkg -i oracle-instantclient11.2-sqlplus_11.2.0.1.0-2_x86_64.deb |
6. On peut vérifier que l'installation de Oracle Instant Client 11g s'est bien passée.
Code:
sudo aptitude search oracle
Code:
1 2 3 4 5 6 7 8
| p cl-sql-oracle - CLSQL database backend, Oracle
p libmono-oracle1.0-cil - Mono Oracle library (for CLI 1.0)
p libmono-oracle2.0-cil - Mono Oracle library (for CLI 2.0)
i oracle-instantclient11.2-basic - Instant Client for Oracle Database 11g
i oracle-instantclient11.2-devel - Development headers for Instant Client.
i oracle-instantclient11.2-sqlplus - SQL*Plus for Instant Client.
p spamoracle - A statistical analysis spam filter based on Bayes' formula
v spamoracle-byte - |
7. Installer le pilote PDO pour Oracle: pdo_oci
Code:
1 2 3 4 5
| sudo apt-get install php5-dev php-pear
cd /tmp
pecl download PDO_OCI
tar xzvf PDO_OCI-1.0.tgz
cd ../PDO_OCI-1.0 |
PDO_OCI-1.0 ne supporte pas la version 11g d'Oracle, mais il est facile de le modifier pour celà.
Vous devez créer un fichier config.m4.patch avec le contenu suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| --- config.m4 2005-09-25 01:23:24.000000000 +0200
+++ config.m4.new 2010-09-01 13:03:43.030964765 +0200
@@ -7,6 +7,8 @@
if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then
PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
test -z "$PDO_OCI_VERSION" && PDO_OCI_VERSION=7.3
+ elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
+ PDO_OCI_VERSION=11.1
elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
PDO_OCI_VERSION=10.1
elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
@@ -119,6 +121,12 @@
10.2)
PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
;;
+ 11.1)
+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+ ;;
+ 11.2)
+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+ ;;
*)
AC_MSG_ERROR(Unsupported Oracle version! $PDO_OCI_VERSION)
;; |
Ensuite appliquez le patch
Code:
patch config.m4 config.m4.patch
Et finalement construisez le et installez le:
Code:
1 2 3 4
| phpize
./configure --with-pdo-oci=instantclient,/usr,11.2
make
sudo make install |
8. Ajoutez les libs Oracle et PDO_OCI dans le php.ini
Code:
sudo vi /etc/php5/apache2/conf.d/oci8.ini
Insérez le contenu suivant et sauvegardez:
Code:
1 2 3
| extension=oci8.so
#extension=pdo.so
extension=pdo_oci.so |
9. Ajouter les librairies Oracle client dans le chemin d’accès des librairies
Créer un fichier /etc/ld.so.conf.d/oracle11-2.conf
Code:
sudo vi /etc/ld.so.conf.d/oracle11-2.conf
Avec le contenu suivant:
Code:
/usr/lib/oracle/11.2/client/lib
10. Redémarrer apache
Code:
sudo /etc/init.d/apache2 restart