{"id":3319,"date":"2014-03-22T02:36:03","date_gmt":"2014-03-22T02:36:03","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/22\/pdo-loads-fine-in-magento-but-not-in-external-cms-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:50:19","modified_gmt":"2022-08-30T15:50:19","slug":"pdo-loads-fine-in-magento-but-not-in-external-cms-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/22\/pdo-loads-fine-in-magento-but-not-in-external-cms-collection-of-common-programming-errors\/","title":{"rendered":"PDO loads fine in Magento but not in external CMS-Collection of common programming errors"},"content":{"rendered":"<p>I am having a problem similar to The PDO extension is required for this adapter but the extension is not loaded but not the same.<\/p>\n<p>The Magento install is running fine but when I try to run:<\/p>\n<pre><code>require_once(APATH.MAGEPATH.'\/app\/Mage.php');\numask(0);\nMage::app();\n<\/code><\/pre>\n<p>in a directory outside of Magento I get the error:<\/p>\n<pre><code>Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in\n\/home\/inzana\/public_html\/Store\/lib\/Zend\/Db\/Adapter\/Pdo\/Abstract.php:342 \nStack trace: #0 \/home\/inzana\/public_html\/Store\/lib\/Zend\/Db\/Adapter\/Abstract.php(247): Zend_Db_Adapter_Pdo_Abstract-&gt;setFetchMode(2) \n#1 \/home\/inzana\/public_html\/Store\/app\/code\/core\/Mage\/Core\/Model\/Resource.php(165): Zend_Db_Adapter_Abstract-&gt;__construct(Array) \n#2 \/home\/inzana\/public_html\/Store\/app\/code\/core\/Mage\/Core\/Model\/Resource.php(110): Mage_Core_Model_Resource-&gt;_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element)) \n#3 \/home\/inzana\/public_html\/Store\/app\/code\/core\/Mage\/Core\/Model\/Resource\/Db\/Abstract.php(320): Mage_Core_Model_Resource-&gt;getConnection('core_write') \n#4 \/home\/inzana\/public_html\/Store\/app\/code\/core\/Mage\/Core\/Model\/Resource\/Db\/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract-&gt;_getConnection('write') \n#5 \/home\/inzana\/public_html\/Store\/app\/code\/core\/Mage\/Core\/Model\/R in \/home\/inzana\/public_html\/Store\/lib\/Zend\/Db\/Adapter\/Pdo\/Abstract.php on line 342\n<\/code><\/pre>\n<p>phpinfo() reports:<\/p>\n<pre><code>'.\/configure' '--disable-fileinfo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' \n'--enable-pdo=shared' '--enable-sockets' '--prefix=\/usr' '--with-curl=\/opt\/curlssl\/' '--with-gd' '--with-imap=\/opt\/php_with_imap_client\/' '--with-imap-ssl=\/usr' '--with-jpeg-dir=\/usr' '--with-kerberos' '--with-libxml-dir=\/opt\/xml2\/' '--with-mcrypt=\/opt\/libmcrypt\/' '--with-mysql=\/usr' '--with-mysql-sock=\/var\/lib\/mysql\/mysql.sock' '--with-openssl=\/usr' '--with-openssl-dir=\/usr' '--with-pcre-regex=\/opt\/pcre' \n'--with-pdo-mysql=shared' \n'--with-pdo-sqlite=shared' '--with-png-dir=\/usr' '--with-sqlite=shared' '--with-xpm-dir=\/usr' '--with-zlib' '--with-zlib-dir=\/usr'\n<\/code><\/pre>\n<p>The local php.ini file includes:<\/p>\n<pre><code>extension=pdo.so\nextension=pdo_sqlite.so\nextension=sqlite.so\nextension=pdo_mysql.so\n<\/code><\/pre>\n<p>I am a loss of where to go next. Any help appreciated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am having a problem similar to The PDO extension is required for this adapter but the extension is not loaded but not the same. The Magento install is running fine but when I try to run: require_once(APATH.MAGEPATH.&#8217;\/app\/Mage.php&#8217;); umask(0); Mage::app(); in a directory outside of Magento I get the error: Fatal error: Uncaught exception &#8216;Zend_Db_Adapter_Exception&#8217; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,1],"tags":[],"class_list":["post-3319","post","type-post","status-publish","format-standard","hentry","category-magento","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3319"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3319\/revisions"}],"predecessor-version":[{"id":9027,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3319\/revisions\/9027"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}