sla363
Modules installed with docker-php-ext-install are not enabled
Project ID: 6ddc3509-9905-4080-9429-3330b1908098
Dockerfile:
FROM php:8.2-apache
RUN apt-get update && apt-get install -y \
libpng-dev \
libzip-dev \
zip \
libpq-dev \
git \
&& docker-php-ext-install pdo pdo_pgsql gd zip
RUN a2enmod rewrite
WORKDIR /var/www/html
COPY . .
RUN sed -i 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/000-default.conf
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN composer install --prefer-dist --no-scripts --no-dev --no-interaction
EXPOSE 80
I've been trying to install and enable a couple of PHP modules via docker-php-ext-install. It works well if I run the build in my local Docker environment using:
docker compose up -d --build
But if I run the deployment on Railway using:
railway up
Everything seems to be completing successfully, but the modules installed with docker-php-ext-install are not loaded.
My local Docker container:
root@0c3851d06742:/var/www/html/bin# php -m
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_pgsql
pdo_sqlite
Phar
posix
random
readline
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
notice the loaded pdo_pgsql, pdo_sqlite, gd and zip modules.
Railway deployment:
sl@SL-DELL:/www/symfony-book-management$ railway run php -m
[PHP Modules]
calendar
Core
ctype
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib
[Zend Modules]
Zend OPcache
pdo_pgsql, pdo_sqlite, gd and zip modules are missing.
Could you please help? Thanks!
9 replies