N
N
Nikolay Matyushkin2018-12-04 21:43:08
PHP
Nikolay Matyushkin, 2018-12-04 21:43:08

When creating a database on SQLite3, it gives the error "Fatal error: Uncaught Error: Class 'SQLite3' not found", how to fix it?

Hello. This link has the same problem, but there is a person on Linux-e, and that solution did not suit me, so I decided to ask. I am using OpenServer.
I am studying at the same course, therefore the same code in which the SQLite database is created:

require "INewsDB.class.php";

  class NewsDB implements INewsDB{
    const DB_NAME = "../news.db";
    const ERR_PROPERTY = "Wrong property name";
    private $_db;
    
    function __construct(){
      $this->_db = new SQLite3(self::DB_NAME);
    }
    
    function __destruct(){
      unset($this->_db);
    }
    
    function __get($name){
      if($name == "db"):
        return $this->_db;
      else:
        throw new Exception(self::ERR_PROPERTY);
      endif;
    }
    
    function __set($name, $value){
      throw new Exception(self::ERR_PROPERTY);
    }
    
    function saveNews($title, $category, $description, $source){
      
    }
    
    function getNews(){
      
    }
    
    function deleteNews($id){
      
    }
  }
  
$news = new NewsDB();

And in general, when creating an instance of this class, it gives an error Fatal error: Uncaught Error: Class 'SQLite3' not found on the line where we create an instance of the SQLite3 class. I looked at php.ini, everything is uncommented there. Please tell me which way to dig.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question