docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.81k stars 2k forks source link

Stop statically compiling the FTP extension #1482

Closed TimWolla closed 9 months ago

TimWolla commented 9 months ago

According to the documentation of ftp_ssl_connect(), the limitation of requiring a static build was lifted with PHP 7.0. Thus stop forcibly including the FTP extension, which should be needed somewhat rarely.

Example:

root@2a4c93db4a86:/var/www/html# apt-get update -qqqqq
root@2a4c93db4a86:/var/www/html# apt-get install -yyyyqqqq libssl-dev
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libssl-dev:amd64.
(Reading database ... 13257 files and directories currently installed.)
Preparing to unpack .../libssl-dev_3.0.11-1~deb12u2_amd64.deb ...
Unpacking libssl-dev:amd64 (3.0.11-1~deb12u2) ...
Setting up libssl-dev:amd64 (3.0.11-1~deb12u2) ...
root@2a4c93db4a86:/var/www/html# docker-php-ext-configure ftp --with-openssl-dir >/dev/null
root@2a4c93db4a86:/var/www/html# docker-php-ext-install ftp >/dev/null
+ strip --strip-all modules/ftp.so
root@2a4c93db4a86:/var/www/html# php -r "var_dump(function_exists('ftp_ssl_connect'));"
bool(true)
tianon commented 9 months ago

Thank you!