Hey,
I am totally new to all this,i needed to know how to compile oci8 on my server which has php4.Please help! 🙂

    Hi,

    is oracle installed on that server (at least the oracle client including the libraries and include files) ? Are the environment variables set (ORACLE_HOME, NLS_LANG, ....) ? Which OS/version is installed ?

    Thomas

      yes we have oracle 10g and windows xp and i am trying to install invision power board on it.

        So the server is running Windows XP ? In that case you don't need to recompile anything. The php_oci8 extension already comes with the zip package. If you installed php with the installer then the php_oci8.dll file might be missing. In that case download the zip package (which contains that extension), copy php_oci8.dll to the extension directory and enable the extension in php.ini.

        Thomas

          First download the zip package that matches your php version from the releases page and unpack the file. The directory ext contains a file named php_oci8.dll. Copy that file to the ext directory of your already working php installation. Then modify the php.ini file and add the line
          extension=php_oci8.dll
          to the extension section. If you can't find php.ini then create a little phpinfo() script and check the top of the output. One row of the table contains the full path to php.ini.

          Edit: Then restart the web server.

            do you know where to check phpinfo()

              i have not done any installations so far , sorry about that!

                Create a PHP script that just contains

                <?PHP
                phpinfo();
                ?>
                

                The output contains information about the php configuration.

                Thomas

                  No, that php version doesn't support the oci8 extension. But this is a redhat linux server. It is possible to enable the oci8 extension without rebuilding PHP from scratch. The windows stuff doesn't help in this case.

                  Luckily enough the Environment section near the end of the page shows that oracle 10g is installed and that the most important environment variables are all set.

                  If there's Redhat Enterprise Linux installed on the server then a php-oci8 rpm package might be available that you can install (easy way).

                  The other way is to compile the oci8 extension yourself:

                  The steps in short (assuming that gcc, make and some other development tools are installed):

                  1. download the php-4.3.9.tar.gz file from the releases page I posted above.
                  2. copy that file somewhere onto your server and extract the file (tar xzf php-4.3.9.tar.gz)
                  3. that will create a directory named php-4.3.9

                  Now some commands:

                  1. cd php-4.3.9/ext
                  2. /usr/bin/phpize
                  3. ./configure --with-oci8 --with-php-config=/usr/bin/php-config
                  4. make
                  5. make install

                  You can add the ORACLE_HOME directory to the --with-oci8 switch in step 3 if something fails. But in this case it should work without the path since the environment variables are set.

                  I'm not sure about the next step completely but I think there are two solutions to enable the extension according to the output of phpinfo:

                  a) add the line extension=oci8.so at the end of /etc/php.ini
                  b) create a new file /etc/php.d/oci8.ini that just contains the line extension=oci8.so

                  Then restart apache.

                  Thomas

                    can i copy the php-4.3.9 folder which i extracted onto /var/www/html/

                      You can do that but I wonder if that is a good idea since this seems to be a public html folder.

                      I'd suggest to copy/move the extracted folder to e.g. /usr/src or a home directory and to compile stuff there.

                        cd php-4.3.9/ext when i cd there what exactly do i do??

                          Ooops, my fault. I missed one directory. If you're in ext then cd to oci8 (php-4.3.9/ext/oci8).

                          Then execute the commands 2. to 5.

                          Thomas

                            o.k. i have put the folder php-4.3.9 in /usr/src ---------is this o.k??

                              Yes, that's ok. It doesn't really matter where that folder is. You can delete it after compiling and installing the extension.

                                i owe you something big for this!!really !!cos i don't know anything!!our System admin sucks,that is why i want to do it on my own!!

                                  sorry i found it ,really sorry??