{"id":259,"date":"2010-04-15T11:05:26","date_gmt":"2010-04-15T03:05:26","guid":{"rendered":"http:\/\/www.genepeng.com\/index.php\/259"},"modified":"2010-04-15T11:07:38","modified_gmt":"2010-04-15T03:07:38","slug":"install_driveroracle-failed-cant-load-dbdoracleoracle-so-for-module-dbdoracle","status":"publish","type":"post","link":"https:\/\/www.genepeng.com\/index.php\/259","title":{"rendered":"install_driver(Oracle) failed: Can&#8217;t load `&#8230;\/DBD\/Oracle\/Oracle.so&#8217; for module DBD::Oracle"},"content":{"rendered":"<p>Description<\/p>\n<p>This section is from the &quot;<a href=\"http:\/\/chestofbooks.com\/computers\/webservers\/apache\/Stas-Bekman\/Practical-mod_perl\/index.html\">Practical mod_perl<\/a> &quot; book, by <a href=\"http:\/\/stason.org\/\">Stas Bekman<\/a> and <a href=\"http:\/\/www.logilune.com\/eric\/\">Eric Cholet<\/a> . Also available from Amazon: <a href=\"http:\/\/www.amazon.com\/dp\/0596002270?tag=ref%3Dnosim&amp;link_code=as3&amp;creativeASIN=0596002270&amp;creative=373489&amp;camp=211189\">Practical mod_perl<\/a><\/p>\n<p><a name=\"pmodperl-CHP-22-SECT-1.2\"><\/a><\/p>\n<p><a name=\"pmodperl-CHP-22-SECT-1.2\">Here&#8217;s an example of the full error <\/a><a name=\"pmodperl-CHP-22-ITERM-5764\">report that you might see:<\/a><\/p>\n<blockquote>\n<pre><a name=\"pmodperl-CHP-22-ITERM-5764\">install_driver(Oracle) failed: Can't load<br \/>\n\n'\/usr\/lib\/perl5\/site_perl\/5.6.1\/i386-linux\/auto\/DBD\/Oracle\/Oracle.so'<br \/>\n\nfor module DBD::Oracle:<br \/>\n\nlibclntsh.so.8.0: cannot open shared object file: <br \/>\n\nNo such file or directory at<br \/>\n\n\/usr\/lib\/perl5\/5.6.1\/i386-linux\/DynaLoader.pm line 169.<br \/>\n\nat (eval 27) line 3<br \/>\n\nPerhaps a required shared<br \/>\n\nlibrary or dll isn't installed where expected at <br \/>\n\n\/usr\/local\/apache\/perl\/tmp.pl line 11<br \/>\n<\/a>\n<img decoding=\"async\" loading=\"lazy\" height=\"244\" alt=\"\" src=\"http:\/\/p.blog.csdn.net\/images\/p_blog_csdn_net\/russle\/EntryImages\/20090930\/oracle_buildforge_ld_config.JPG\" width=\"597\" \/>\n <br \/><\/pre>\n<\/blockquote>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">On BSD-style filesystems, <tt>LD_LIBRARY_PATH<\/tt> is not searched for <strong>setuid<\/strong> programs. If Apache is a <strong>setuid<\/strong> executable, you might receive this error. Therefore, the first solution is to explicitly load the library from the system-wide <strong>ldconfig<\/strong> configuration file:<\/a><\/p>\n<blockquote>\n<pre><a name=\"pmodperl-CHP-22-ITERM-5764\">panic# echo $ORACLE_HOME\/lib &gt;&gt; \/etc\/ld.so.conf<br \/>\n\npanic# ldconfig<br \/>\n\n(\u4f7f\u7528\u8be5\u65b9\u6cd5\u6211\u7684\u95ee\u9898\u5c31\u89e3\u51b3\u4e86)<\/a><\/pre>\n<\/blockquote>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">Another solution to this problem is to modify the <strong>Makefile<\/strong> file (which is created when you run <strong>perl Makefile.PL<\/strong> ) as follows:<\/a><\/p>\n<ol>\n<li>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">Search for the line <tt>LD_RUN_PATH=<\/tt><\/a><\/p>\n<\/li>\n<li>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">Replace it with <tt>LD_RUN_PATH=my_oracle_home\/lib<\/tt><\/a><\/p>\n<\/li>\n<\/ol>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">where <strong>my_oracle_home<\/strong> is, of course, the home path to your Oracle installation. In particular, the file <strong>libclntsh.so.8.0<\/strong> should exist in the <strong>lib<\/strong> subdirectory.<\/a><\/p>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">Then just type <strong>make install<\/strong> , and all should go well.<\/a><\/p>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">Note that setting <tt>LD_RUN_PATH<\/tt> has the effect of hardcoding the path to <strong>my_oracle_home\/lib<\/strong> in the file <strong>Oracle.so<\/strong> , which is generated by <tt>DBD::Oracle<\/tt> . This is an efficiency mechanism, so that at runtime it doesn&#8217;t have to search through <tt>LD_LIBRARY_PATH<\/tt> or the default directories used by <strong>ld<\/strong>.<\/a><\/p>\n<p><a name=\"pmodperl-CHP-22-ITERM-5764\">For more information, see the <strong>ld<\/strong> manpage and the essay on <tt>LD_LIBRARY_PATH<\/tt> at <\/a><a href=\"http:\/\/www.visi.com\/%7Ebarr\/ldpath.html\">http:\/\/www.visi.com\/~barr\/ldpath.html<\/a> .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description This section is from the &quot;Practical mod_perl &quot; book, by Stas Bekman and Eric Cholet . Also available from Amazon: Practical mod_perl Here&#8217;s an example of the full error report that you might see: install_driver(Oracle) failed: Can&#8217;t load &#8216;\/usr\/lib\/perl5\/site_perl\/5.6.1\/i386-linux\/auto\/DBD\/Oracle\/Oracle.so&#8217; for module DBD::Oracle: libclntsh.so.8.0: cannot open shared object file: No such file or directory at &#8230; <a title=\"install_driver(Oracle) failed: Can&#8217;t load `&#8230;\/DBD\/Oracle\/Oracle.so&#8217; for module DBD::Oracle\" class=\"read-more\" href=\"https:\/\/www.genepeng.com\/index.php\/259\" aria-label=\"More on install_driver(Oracle) failed: Can&#8217;t load `&#8230;\/DBD\/Oracle\/Oracle.so&#8217; for module DBD::Oracle\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/259"}],"collection":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":2,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/259\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/categories?post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/tags?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}