Search code examples
phpsqlitecentos7

configure error: Package requirements (sqlite3 > 3.7.4) were not met


I'm trying to install php on Centos 7 following instructions from: https://www.php.net/manual/en/install.unix.nginx.php. My nginx version: nginx/1.19.0

I downloaded php-7.4.6.tar.gz from https://www.php.net/downloads but at the step:

./configure --enable-fpm --with-mysqli

I got this error:

checking for sqlite3 > 3.7.4... no
configure: error: Package requirements (sqlite3 > 3.7.4) were not met:

No package 'sqlite3' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables SQLITE_CFLAGS
and SQLITE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I do have sqlite3 up and running:

# sqlite3
SQLite version 3.7.17

So, how should I set the environment variable (in configure file?)? Thanks!


Solution

  • To compile from source, dependencies need to be available as a linkable library (and sometimes headers which the new program uses for building). -devel packages install these libraries, so to build PHP from source with SQLite support, you need to install sqlite-devel.

    If you have Ubuntu >= 20.04, install this package libsqlite3-dev to satisfy the dev dependency/package requirements.