安装 php-sqlite3 之后,执行php -m 命令有警告,如下
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib64/php/modules/pdo_sqlite (/usr/lib64/php/modules/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo_sqlite.so (/usr/lib64/php/modules/pdo_sqlite.so: undefined symbol: sqlite3_column_table_name)) in Unknown on line 0
这种一般是本机的 /usr/local/lib/libsqlite3.so.0 类库问题,可以重新安装或者编译安装sqlite3
bash
cd /usr/local/src
wget https://www.sqlite.org/2023/sqlite-autoconf-3410200.tar.gz
tar xvzf sqlite-autoconf-3410200.tar.gz
cd sqlite-autoconf-3410200/
CFLAGS="-O2 -DSQLITE_ENABLE_COLUMN_METADATA=1" ./configure
make -j4
make install
安装之后,警告解决,不再提示