Skip to content

Commit 2bf56b6

Browse files
committed
recompile mod php
1 parent 90b06bc commit 2bf56b6

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

docker/Dockerfile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ WORKDIR /usr/src
77
RUN apt-get update && apt-get install -y \
88
wget make gcc g++ \
99
libjpeg-dev libpng-dev libwebp-dev \
10-
unzip git
10+
unzip git apache2-dev \
11+
libsqlite3-dev pkg-config
1112

1213
# Build and install latest SQLite (3.49.1)
1314
RUN wget https://www.sqlite.org/2025/sqlite-autoconf-3490100.tar.gz && \
@@ -16,10 +17,10 @@ RUN wget https://www.sqlite.org/2025/sqlite-autoconf-3490100.tar.gz && \
1617
./configure --prefix=/usr/local && make && make install && \
1718
cd .. && rm -rf sqlite-autoconf-3490100*
1819

19-
# Make sure PHP uses the correct SQLite headers and libs
20-
ENV CPPFLAGS="-I/usr/local/include"
21-
ENV LDFLAGS="-L/usr/local/lib"
22-
ENV LD_LIBRARY_PATH="/usr/local/lib"
20+
# Replace SQLite
21+
RUN cp /usr/local/bin/sqlite3 /usr/bin/sqlite3 && \
22+
cp /usr/local/lib/libsqlite3.so* /usr/lib/ && \
23+
ldconfig
2324

2425
# Rebuild PHP with the new SQLite version
2526
RUN docker-php-source extract && \
@@ -30,10 +31,21 @@ RUN docker-php-source extract && \
3031
docker-php-ext-enable pdo_sqlite && \
3132
docker-php-source delete
3233

33-
# Configure and install other extensions
34+
# Install PHP extensions with correct SQLite version
3435
RUN docker-php-ext-configure gd --with-jpeg --with-webp && \
3536
docker-php-ext-install pdo gd
3637

38+
# Rebuild Apache PHP module
39+
RUN a2dismod php8.3 && \
40+
docker-php-source extract && \
41+
cd /usr/src/php && \
42+
./buildconf --force && \
43+
./configure --with-apxs2 --with-pdo-mysql --with-pdo-sqlite=/usr/local --with-sqlite3=/usr/local && \
44+
make && \
45+
make install && \
46+
a2enmod php8.3 && \
47+
docker-php-source delete
48+
3749
# Copy application code
3850
WORKDIR /var/www
3951
COPY web/ web/

0 commit comments

Comments
 (0)