Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php8.2.15 removed ftp extension #1488

Open
Angoll opened this issue Jan 23, 2024 · 13 comments
Open

php8.2.15 removed ftp extension #1488

Angoll opened this issue Jan 23, 2024 · 13 comments

Comments

@Angoll
Copy link

Angoll commented Jan 23, 2024

Hello!
The update from 8.2.14 to 8.2.15 removed the ftp extension (see 7512769), extension that needs to be statically compiled (see #236)

I believe that should not be removed in a minor upgrade. 😢
We fixed to the 8.2.14 but we would like to have minor upgrades without having to manage images from scratch.

Thanks

@tianon
Copy link
Member

tianon commented Jan 23, 2024

Hmm, I think we need to dig into the "Before PHP 7.0.0" bit of https://www.php.net/manual/en/function.ftp-ssl-connect.php, because from the docs, this should be working fine. 😕

@tianon
Copy link
Member

tianon commented Jan 23, 2024

Ah, this is due to https://github.com/php/php-src/blob/php-8.2.15/ext/ftp/config.m4#L21-L24, but just passing --with-openssl is not enough to let it know that we do have PHP with OpenSSL support. 😞

@tianon
Copy link
Member

tianon commented Jan 23, 2024

Confirmed, installing libssl-dev and invoking docker-php-ext-configure ftp --with-openssl-dir=/usr before docker-php-ext-install ftp gives me ftp_ssl_connect() successfully.

@tianon
Copy link
Member

tianon commented Jan 23, 2024

More concretely:

FROM php:8.2

RUN apt-get update && apt-get install -y libssl-dev

RUN docker-php-ext-configure ftp --with-openssl-dir=/usr \
	&& docker-php-ext-install ftp

@M-Arthur
Copy link

M-Arthur commented Jan 24, 2024

Will the ftp be added back in the future Docker images?

I need to know it to decide whether to apply manual ftp installation temporarily or permanently. Thanks.

@tianon
Copy link
Member

tianon commented Jan 24, 2024

Unfortunately, we don't plan to add it back to the default set, no.

@Angoll
Copy link
Author

Angoll commented Jan 24, 2024

@tianon thanks for the workaround and clarifying that is not be added back.

Is there any reason that got the package removed in the first place in a minor upgrade?

Thanks

@tianon
Copy link
Member

tianon commented Jan 24, 2024

It should've only been included in the 5.x versions in the original PR that added it (because the underlying issue was fixed in 7+) 😅

The other option we considered was to remove it in the previous version as a normal image update (without waiting for a version change), and we opted for the slightly more conservative switch instead.

@TimWolla
Copy link
Contributor

TimWolla commented Feb 1, 2024

Confirmed, installing libssl-dev and invoking docker-php-ext-configure ftp --with-openssl-dir=/usr before docker-php-ext-install ftp gives me ftp_ssl_connect() successfully.

FWIW: I've intentionally listed the necessary steps in #1482, so that it is not necessary for someone else to research this 😅

@TE7
Copy link

TE7 commented Feb 2, 2024

More concretely:

FROM php:8.2

RUN apt-get update && apt-get install -y libssl-dev

RUN docker-php-ext-configure ftp --with-openssl-dir=/usr \
	&& docker-php-ext-install ftp

Do you mind to explain how to use this solution? From what I understand I'm supposed to create Dockerfile with from/run commands. Where do I place Dockerfile and how do I call it from my Docker compose file? Can those commands be run from Ubuntu terminal and how?
Thank you.

@tianon
Copy link
Member

tianon commented Feb 2, 2024

See https://docs.docker.com/compose/compose-file/compose-file-v3/#build

@TE7
Copy link

TE7 commented Feb 2, 2024

@IronSean
Copy link

IronSean commented May 21, 2024

More concretely:

FROM php:8.2

RUN apt-get update && apt-get install -y libssl-dev

RUN docker-php-ext-configure ftp --with-openssl-dir=/usr \
	&& docker-php-ext-install ftp

When attempting this not with the php8.2 image directly but with a downstream image built on it I run into this error:

3.018 configure: error: in `/usr/src/php/ext/ftp':
3.018 configure: error: The pkg-config script could not be found or is too old.  Make sure it
3.018 is in your PATH or set the PKG_CONFIG environment variable to the full
3.018 path to pkg-config.
3.018 
3.018 Alternatively, you may set the environment variables OPENSSL_CFLAGS
3.018 and OPENSSL_LIBS to avoid the need to call pkg-config.
3.018 See the pkg-config man page for more details.
3.018 
3.018 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
3.018 See `config.log' for more details

However, running RUN docker-php-ext-install ftp right after my FROM statement listing the base image seems to be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants