After successfully installing the PDO extension through a simple ‘pecl install package2.xml’ from inside pdo’s directory of the php-5.2.5 sources, this is what I did:
(Note that I have done an ‘apt-get source php5′ in /usr/src, and un-tar-ed it in the same place.)
/usr/src/php-5.2.5/ext/pdo_oci$ sudo phpize5 Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 /usr/src/php-5.2.5/ext/pdo_oci$ sudo ./configure --prefix=/usr --with-pdo-oci=/usr/lib/oracle/10.2.0.3/client (... usual ./configure output ...)
Now, if I try to run make, I get some dependency problems:
In file included from /usr/src/php-5.2.5/ext/pdo_oci/pdo_oci.c:31: /usr/src/php-5.2.5/ext/pdo_oci/php_pdo_oci_int.h:21:17: error: oci.h: No such file or directory
So, I ‘vi Makefile’ and added the oracle lib path to the ‘INCLUDES=’ line, like that:
INCLUDES = -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 -I/usr/lib/oracle/10.2.0.3/client/lib
then I was able to do the usual ’sudo make && sudo make install’ and all was good.
UPDATE: I have actually found what seems to be the most correct way of telling the compiler where to look for headers. You have to use ldconfig to point to the directories that hold them.
Now, the instantclient packages install things in two different directories: /usr/lib/oracle and /usr/include/oracle. We will add links to both:
$ sudo ldconfig /usr/lib/oracle/10.2.0.3/client/lib $ sudo ldconfig /usr/include/oracle/10.2.0.3/client
These should be enough in order for our usual ’sudo make && sudo make install’ work as usual!
Valeu pela dica, funcionou beleza. Eu já havia quebrado a cabeça algumas vezes tentando tutoriais fajuntos por aí e tinha desistido por um tempo até ver a dica aqui e resolvi dar um última chance.
[...] This post explains my first attempts in getting PDO_OCI installed in Debian. Even though it works and has served me quite well for some time, now I’ve found a way to make actual .deb packages of these modules so I can save them for later use (or distribution, as long as their source code goes along) and have them installed in a sane way via the package manager. [...]
[...] the Debian way (almost) 31 03 2009 Following up to this post and this post, here’s quick instructions on how to actually get the proper pdo_oci package on [...]