how to enable sqlite3 for php?

前端 未结 15 772
野性不改
野性不改 2020-11-28 03:53

I am trying to install sqlite3 for PHP in Ubuntu.

I install apt-get php5-sqlite3 and edited php.ini to include sqlite3 extension.

W

相关标签:
15条回答
  • 2020-11-28 04:13

    Only use:

    sudo apt-get install php5-sqlite
    

    and later

    sudo service apache2 restart
    
    0 讨论(0)
  • 2020-11-28 04:14

    one thing I want to add , before you try to install

    apt-get install php5-sqlite
    

    or

    apt-get install php5-sqlite3 
    

    search the given package is available or not :-

     # apt-cache search 'php5'
    

    After that you get :-

    php5-rrd - rrd module for PHP 5
    
    php5-sasl - Cyrus SASL extension for PHP 5
    
    php5-snmp - SNMP module for php5
    
    **php5-sqlite - SQLite module for php5**
    
    php5-svn - PHP Bindings for the Subversion Revision control system
    
    php5-sybase - Sybase / MS SQL Server module for php5
    

    Here you get an idea about whether your version support or not .. in my system I get php5-sqlite - SQLite module for php5 so I prefer to install

    **apt-get install php5-sqlite**
    
    0 讨论(0)
  • 2020-11-28 04:15

    Depends on the version of PHP. For php7.0 the following commands work:
    sudo apt-get install php7.0-sqlite3
    then restart the Apache server:
    sudo service apache2 restart

    0 讨论(0)
  • 2020-11-28 04:18

    For PHP7, use

    sudo apt-get install php7.0-sqlite3
    

    and restart Apache

    sudo apache2ctl restart
    
    0 讨论(0)
  • 2020-11-28 04:23
    sudo apt-get install php5-cli php5-dev make
    
    sudo apt-get install libsqlite3-0 libsqlite3-dev
    
    sudo apt-get install php5-sqlite3
    
    sudo apt-get remove php5-sqlite3
    
    cd ~
    
    wget http://pecl.php.net/get/sqlite3-0.6.tgz
    
    tar -zxf sqlite3-0.6.tgz
    
    cd sqlite3-0.6/
    
    sudo phpize
    
    sudo ./configure
    

    That worked for me.

    0 讨论(0)
  • 2020-11-28 04:23

    try this:

    sudo apt-get --purge remove php5*
    sudo apt-get install php5 php5-sqlite php5-mysql
    sudo apt-get install php-pear php-apc php5-curl
    sudo apt-get autoremove
    sudo apt-get install php5-sqlite
    sudo apt-get install libapache2-mod-fastcgi php5-fpm php5
    
    0 讨论(0)
提交回复
热议问题