<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Saeid Zebardast&#039;s Blog &#187; oci8</title> <atom:link href="http://zebardast.ir/en/tag/oci8/feed/" rel="self" type="application/rss+xml" /><link>http://zebardast.ir/en</link> <description></description> <lastBuildDate>Sun, 23 Oct 2011 18:18:07 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator><image><title>Saeid Zebardast&#039;s Blog</title> <url>http://0.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc.png?s=48</url><link>http://zebardast.ir/en</link> </image> <item><title>Install Oracle Instant Client and PHP OCI8 module</title><link>http://zebardast.ir/en/install-oracle-instant-client-and-php-oci8-module/</link> <comments>http://zebardast.ir/en/install-oracle-instant-client-and-php-oci8-module/#comments</comments> <pubDate>Sun, 10 Aug 2008 04:52:15 +0000</pubDate> <dc:creator>Saeid Zebardast</dc:creator> <category><![CDATA[howto]]></category> <category><![CDATA[Oracle]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[oci]]></category> <category><![CDATA[oci8]]></category><guid isPermaLink="false">http://zebardast.wordpress.com/?p=21</guid> <description><![CDATA[If you want to connect to an Oracle database with PHP, you can use Oracle&#8217;s Instant Client and the oci8 module from pear. Download the Basic and the SDK packages from oracle.com. At the time of this writing, the filenames are instantclient-basic.zip and instantclient-sdk.zip. Unzip these files in a new directory, e.g. /opt/oracle/instantclient. Code: The [...] Related posts:<ol><li><a href='http://zebardast.ir/en/how-to-install-gos-on-ubuntu-gutsy-gibbon/' rel='bookmark' title='How to install gOS on Ubuntu Gutsy Gibbon'>How to install gOS on Ubuntu Gutsy Gibbon</a></li></ol>]]></description> <content:encoded><![CDATA[<p>If you want to connect to an Oracle database with PHP, you can use Oracle&#8217;s Instant Client and the oci8 module from pear.</p><p>Download the Basic and the SDK packages from <a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html">oracle.com</a>. At the time of this writing, the filenames are instantclient-basic.zip and instantclient-sdk.zip.</p><p>Unzip these files in a new directory, e.g. /opt/oracle/instantclient.</p><p>Code:</p><pre class="brush: bash; title: ; notranslate">
sudo su
mkdir -p /opt/oracle/instantclient
cd /opt/oracle/instantclient
unzip instantclient-basic.zip
unzip instantclient-sdk.zip
echo /opt/oracle/instantclient &amp;gt;&amp;gt; /etc/ld.so.conf
ldconfig
</pre><p>The previous two lines are supposed to create symlinks named libclntsh.so and libocci.so which we will need later. In my case these symlinks were not created by ldconfig, so I created them manually.</p><p>Code:</p><pre class="brush: bash; title: ; notranslate">
ln -s libclntsh.so.11.1 libclntsh.so
ln -s libocci.so.11.1 libocci.so
</pre><p>In the next step we will download the oci8 module with pear. Pear is in the php-pear package.</p><p>Code:</p><pre class="brush: bash; title: ; notranslate">
apt-get install php-pear
</pre><p>Also, you need php5-dev and build-essential packages for compiling oci8 module.</p><p>Code:</p><pre class="brush: bash; title: ; notranslate">
apt-get install php-pear php5-dev build-essential
</pre><p>&#8220;Normally&#8221; we should be able to just use <em>pecl install oci8</em> now, but apparently pear is not able to figure out where the instantclient libraries are. So we will just download the oci8 module and build it on our own.</p><p>Code:</p><pre class="brush: bash; title: ; notranslate">
mkdir -p /usr/local/src
cd /usr/local/src
pecl download oci8
tar xzf oci8-1.3.4.tgz
cd oci8-1.3.4
phpize
./configure --with-oci8=shared,instantclient,/opt/oracle/instantclient
make
make install
</pre><p>The oci8-1.3.4.tgz filename will of course change for newer releases.</p><p>To enable the oci8 module in the php.ini (/etc/php5/apache2/php.ini and /etc/php5/cli/php.ini), add a line<br /> Code:</p><pre class="brush: plain; title: ; notranslate">
extension=oci8.so
</pre><p>(put this line after the examples starting with ;extension).</p><p>Now stop and start Apache. You should see the oci8 module in the output of phpinfo().</p><p>Good luck</p><div class="wp-biographia-container-top" style="background-color:#FFEAA8;"><div class="wp-biographia-pic"><img alt='' src='http://1.gravatar.com/avatar/1518e6b905d65cbe0a03243a199e18fc?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-biographia-text"><h3>About <a href="http://zebardast.ir/en/author/admin/" title="Saeid Zebardast">Saeid Zebardast</a></h3><p>I'm Senior software engineer with 5+ years of professional experience includes cross-platform proficiency with considerable knowledge of programming languages especially Java and programming paradigms such as OO and development methodologies. Also I'm MySQL DBA since 2006.</p><small><a href="mailto:&#115;a&#101;i&#100;&#46;ze&#98;&#97;rd&#97;s&#116;&#64;g&#109;ail&#46;&#99;om" title="Send Saeid Zebardast Mail">Mail</a> | <a href="http://zebardast.ir/" title="Saeid Zebardast On The Web">Web</a> | <a href="https://twitter.com/#!/saeid" title="Saeid Zebardast On Twitter">Twitter</a> | <a href="https://www.facebook.com/saeid.zebardast" title="Saeid Zebardast On Facebook">Facebook</a> | <a href="http://www.linkedin.com/in/saeid" title="Saeid Zebardast On LinkedIn">LinkedIn</a> | <a href="https://plus.google.com/112638433061122581433" title="Saeid Zebardast On Google+">Google+</a> | <a href="http://zebardast.ir/en/author/admin/" title="More Posts By Saeid Zebardast">More Posts (31)</a></small></div></div><p><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Finstall-oracle-instant-client-and-php-oci8-module%2F&amp;linkname=Install%20Oracle%20Instant%20Client%20and%20PHP%20OCI8%20module" title="Google+" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google+"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Finstall-oracle-instant-client-and-php-oci8-module%2F&amp;linkname=Install%20Oracle%20Instant%20Client%20and%20PHP%20OCI8%20module" title="Facebook" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fzebardast.ir%2Fen%2Finstall-oracle-instant-client-and-php-oci8-module%2F&amp;linkname=Install%20Oracle%20Instant%20Client%20and%20PHP%20OCI8%20module" title="Twitter" rel="nofollow" target="_blank"><img src="http://zebardast.ir/en/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fzebardast.ir%2Fen%2Finstall-oracle-instant-client-and-php-oci8-module%2F&amp;title=Install%20Oracle%20Instant%20Client%20and%20PHP%20OCI8%20module" id="wpa2a_2"><span style='display:none'>Share</span></a></p><p>Related posts:<ol><li><a href='http://zebardast.ir/en/how-to-install-gos-on-ubuntu-gutsy-gibbon/' rel='bookmark' title='How to install gOS on Ubuntu Gutsy Gibbon'>How to install gOS on Ubuntu Gutsy Gibbon</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://zebardast.ir/en/install-oracle-instant-client-and-php-oci8-module/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 5/20 queries in 0.007 seconds using disk: basic
Object Caching 711/727 objects using disk: basic

Served from: zebardast.ir @ 2012-02-09 10:10:48 -->
