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!
6
Answers
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 installsqlite-devel
.If you have Ubuntu >= 20.04, install this package
libsqlite3-dev
to satisfy the dev dependency/package requirements.The command
sudo apt-get install sqlite3
works for ubuntu.sudo apt install libsqlite3-dev
will work. To know which libraries to install you may findapt search sqlite3
useful.for ubuntu21.04 I needed to use
sudo apt install libsqlite3-dev
On Ubuntu 22.04 I had the same problem after installing :-
To get round this :-
Then add the folder that contains that file to :-