skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. The command sudo apt-get install sqlite3 works for ubuntu.

    Login or Signup to reply.
  3. sudo apt install libsqlite3-dev will work. To know which libraries to install you may find apt search sqlite3 useful.

    Login or Signup to reply.
  4. for ubuntu21.04 I needed to use sudo apt install libsqlite3-dev

    Login or Signup to reply.
  5. sudo apt-get install -y libbz2-dev sqlite3 libsqlite3-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libonig-dev libreadline-dev libtidy-dev libxslt-dev libzip-dev
    
    Login or Signup to reply.
  6. On Ubuntu 22.04 I had the same problem after installing :-

    sudo apt-get install sqlite3 libsqlite3-dev
    

    To get round this :-

    sudo find / -name sqlite3.pc
    

    Then add the folder that contains that file to :-

    export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search