pdo sqlite could not find driver… php file not processing

前端 未结 4 1025
-上瘾入骨i
-上瘾入骨i 2020-12-03 10:37

Hi i\'m received the could not find driver error when trying to connect to sqlite via a php file. I\'ve set permission to 777... PHP Version 5.2.16, i have

相关标签:
4条回答
  • 2020-12-03 11:14

    On archlinux i had to do two things:

    first install php-sqlite

    pacman -S php-sqlite
    

    after that in my php.ini file for me in /etc/php/php.ini i had to uncomment this line:

    ;extension=pdo_sqlite.so
    

    by removing semicolon.

    Dont forget to restart server.

    0 讨论(0)
  • 2020-12-03 11:16

    I had to actually install the extension, and this is how i did on Ubuntu 16 running PHP 7.1:

    sudo apt install php7.1-sqlite3

    0 讨论(0)
  • 2020-12-03 11:28

    You need

    [PDO_SQLITE]
    extension=pdo_sqlite.so
    

    to be enabled, for sqlite:.subscribers.db

    or, for windows:

    [PHP_PDO_SQLITE]
    extension=php_pdo_sqlite.dll
    

    And ofcourse this extension in your ext directory

    0 讨论(0)
  • 2020-12-03 11:29

    I am using a portable version of PHP on windows, using the inbuilt web server. I found the following steps helped:

    1. Renaming php.ini-development to php.ini
    2. Uncommenting extension_dir = "ext" under [PHP] (around line 700)
    3. making sure the following lines are in the php.ini:
    [sqlite3]    
    sqlite3.extension_dir = "ext"    
    extension = sqlite3    
    extension = pdo_sqlite
    
    1. Running the php webserver with the following flag added on: - c C:\Path\to\PortablePHP\php.ini

    So currently my php command is php -S localhost:8081 -c B:\Downloads\php-7.2.6\php.ini.

    0 讨论(0)
提交回复
热议问题