admin管理员组文章数量:1244386
I want to use the latest version of sqlite (3.49.0 from this writing) in PHP.
I'm using docker and for latest docker image cli version (php:8.2-cli) sqlite3 shows the following version:
$ docker compose run --rm php php -r "echo SQLite3::version()['versionString'] . PHP_EOL;"
3.40.1
After I manually install the latest sqlite3 version via the following
RUN curl -L .tar.gz | tar xz && \
cd sqlite-autoconf-3490000 && \
./configure --prefix=/usr/local && \
make && make install && \
cd .. && rm -rf sqlite-*
I can see that sqlite3 is at latest version
$ docker compose run --rm php sqlite3 --version
3.49.0 2025-02-06
but the PDO version is still at older version:
$ docker compose run --rm php php -r "echo SQLite3::version()['versionString'] . PHP_EOL;"
3.40.1
My question is, how do I update PDO to use the latest sqlite3 version?
--- edit with answer ---
Dockerfile with custom PDO:
FROM php:8.2-cli
RUN apt-get update && apt-get install -y \
wget \
build-essential \
libxml2-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN curl -L .tar.gz | tar xz && \
cd sqlite-autoconf-3490000 && \
./configure && \
make && make install && \
cd .. && rm -rf sqlite-*
RUN docker-php-ext-disable pdo_sqlite
RUN docker-php-source extract \
&& cd /usr/src/php \
&& ./configure \
--with-pdo-sqlite=/usr/local \
&& make -j$(nproc) \
&& make install \
&& docker-php-source delete
RUN docker-php-ext-configure pdo_sqlite --with-pdo-sqlite=/usr/local \
&& docker-php-ext-install pdo_sqlite
I want to use the latest version of sqlite (3.49.0 from this writing) in PHP.
I'm using docker and for latest docker image cli version (php:8.2-cli) sqlite3 shows the following version:
$ docker compose run --rm php php -r "echo SQLite3::version()['versionString'] . PHP_EOL;"
3.40.1
After I manually install the latest sqlite3 version via the following
RUN curl -L https://www.sqlite./2025/sqlite-autoconf-3490000.tar.gz | tar xz && \
cd sqlite-autoconf-3490000 && \
./configure --prefix=/usr/local && \
make && make install && \
cd .. && rm -rf sqlite-*
I can see that sqlite3 is at latest version
$ docker compose run --rm php sqlite3 --version
3.49.0 2025-02-06
but the PDO version is still at older version:
$ docker compose run --rm php php -r "echo SQLite3::version()['versionString'] . PHP_EOL;"
3.40.1
My question is, how do I update PDO to use the latest sqlite3 version?
--- edit with answer ---
Dockerfile with custom PDO:
FROM php:8.2-cli
RUN apt-get update && apt-get install -y \
wget \
build-essential \
libxml2-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN curl -L https://www.sqlite./2025/sqlite-autoconf-3490000.tar.gz | tar xz && \
cd sqlite-autoconf-3490000 && \
./configure && \
make && make install && \
cd .. && rm -rf sqlite-*
RUN docker-php-ext-disable pdo_sqlite
RUN docker-php-source extract \
&& cd /usr/src/php \
&& ./configure \
--with-pdo-sqlite=/usr/local \
&& make -j$(nproc) \
&& make install \
&& docker-php-source delete
RUN docker-php-ext-configure pdo_sqlite --with-pdo-sqlite=/usr/local \
&& docker-php-ext-install pdo_sqlite
Share
Improve this question
edited Feb 16 at 15:31
Karlo
asked Feb 16 at 14:52
KarloKarlo
1643 silver badges9 bronze badges
1 Answer
Reset to default 0My question is, how do I update PDO to use the latest sqlite3 version?
You have to update the PDO extension, and specifically the sqlite3 driver extension of PDO with the updated libraries as well.
PDO is part of core, you can find the source code here: https://github/php/php-src/?tab=readme-ov-file#building-php-source-code
SQLite3 is already mentioned in the prerequisites before make.
本文标签: PHP Sqlite PDO latest versionStack Overflow
版权声明:本文标题:PHP Sqlite PDO latest version - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740203346a2240610.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论