Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For instantclient on osx 10.6 64bit do the following:</p> <p>download the instant client librarys and sdk, stuff it all in a folder. Make sure you get the 64 bit library if you are on a 64 bit machine, 32bit won't work! - test with sqlplus first</p> <p>create this if it does not exist</p> <pre><code>sudo vi /etc/launchd.conf </code></pre> <p>and add to following to the file(with your own path!)</p> <pre><code>setenv DYLD_LIBRARY_PATH /usr/oracle_instantClient64 </code></pre> <p>You probaby need to restart your system at this point for launchd to pass the path to apache to pick up the path, or see if restarting launchd works, though i have a feeling that will restart your system anyway!</p> <p>You should add "extension=oci8.so" to php.ini</p> <pre><code>sudo vi /etc/php.ini </code></pre> <p>if that file does not exist copy php.ini.default</p> <pre><code>sudo cp /etc/php.ini.default /etc/php.ini </code></pre> <p>then add the above extension, there is a section with lots of extensions further down the file, put it there somewhere</p> <p>oci requires a library symlink so do</p> <pre><code>sudo ln -s $DYLD_LIBRARY_PATH/libclntsh.dylib.10.1 $DYLD_LIBRARY_PATH/libclntsh.dylib </code></pre> <p>Also theres some wierd hardcoded library link in the oracle binaries so fix that</p> <pre><code>mkdir -p /b/227/rdbms/ </code></pre> <p>Its only looking for the oracle libraries so link it back</p> <pre><code>ln -s /usr/oracle_instantClient64/ /b/227/rdbms/lib </code></pre> <p>now install oci8 from pear repository. If you have installed snow leopard osx 10.6 without upgrading you may have problems with pear and pecl. If so you will need to install pear first. see: <a href="https://discussions.apple.com/thread/2602597?start=0&amp;tstart=0" rel="nofollow">https://discussions.apple.com/thread/2602597?start=0&amp;tstart=0</a></p> <pre><code>sudo pecl install oci8 </code></pre> <p>HINT: don't use autodetect, specify the instantclient path when it asks you..</p> <pre><code>instantclient,/usr/oracle_instantClient64 </code></pre> <p>restart apache</p> <pre><code>sudo apachectl graceful </code></pre> <p>test by navigating to the URL in a browser or you can call the file directly on the command line</p> <pre><code>php index.php </code></pre> <p>thats it use the following as a test file..</p> <pre><code>&lt;?php $dbHost = "localhostOrDatabaseURL"; $dbHostPort="1521"; $dbServiceName = "servicename"; $usr = "username"; $pswd = "password"; $dbConnStr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=".$dbHost.")(PORT=".$dbHostPort.")) (CONNECT_DATA=(SERVICE_NAME=".$dbServiceName.")))"; if(!$dbConn = oci_connect($usr,$pswd,$dbConnStr)){ $err = oci_error(); trigger_error('Could not establish a connection: ' . $err['message'], E_USER_ERROR); }; $strSQL = "SELECT SYSDATE FROM DUAL"; $stmt = oci_parse($dbConn,$strSQL); if ( ! oci_execute($stmt) ){ $err = oci_error($stmt); trigger_error('Query failed: ' . $err['message'], E_USER_ERROR); }; while(oci_fetch($stmt)){ $rslt = oci_result($stmt, 1); print "&lt;h3&gt;query returned: ".$rslt."&lt;/h3&gt;"; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload