Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

zend framework basic problem  - cannot redeclare class Zend_DB

Posted on 2010-11-16
2
Medium Priority
?
1,651 Views
Last Modified: 2013-11-10
Hi Experts,

when trying to Zend_DB:: factory  I am getting a fatal error:

Fatal error: Cannot redeclare class Zend_Db in /usr/local/zendsvr/share/ZendFramework/library/Zend/Db.php on line 33  


ini_set('display_errors', true);
 error_reporting(E_ALL);

 $library = '/usr/local/zendsvr/share/ZendFramework/library';

 set_include_path($library);
 
  require_once 'Zend/Loader.php';
  Zend_Loader::registerAutoload();
 
  echo '<h1> my ibm is running :'.Zend_Version::VERSION;
   
 
   $options = array(Zend_DB::CASE_FOLDING => Zend_DB::CASE_UPPER);

   
   $db = Zend_DB::factory('Db2',
    array(  
 
    'host'  => '127.0.0.1',
    'dbname' => 'xxxxx',
     'username' => 'xxx',
     'password' =>'xxx',
     'os' => 'i5',
    'options' => $options)
  );
 
   
   
 
 
?>
0
Comment
Question by:iskibinska
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
dsmile earned 1500 total points
ID: 34152967
Seems that class Zend_Db was declared at least twice from your code.

It's hard to debug from that error, I can only suggest that you debug this way:
1. is there any more file that declare class Zend_DB? is yes then move them to other path outside your include path
2. is there any changes that Zend_Db called (using require, include) more that once? it yes then replace the call with require_once, include_once
0
 

Author Closing Comment

by:iskibinska
ID: 34234249
n
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question