Skip to content

Is there a way to uninstall an extension? #601

Answered by mlocati
K2ouMais asked this question in Q&A
Discussion options

You must be logged in to vote

Let's say that you have installed the GD extension.
If you want to disable it, you simply have to delete the ini file that tells PHP to load it.
For example:

rm "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini"

If you'd like to disable it temporarily, you can simply prepend a ; to the extension= (or zend_extension=) directive.

This can be done with this command:

sed -Ei 's/^([ \t]*(zend_)?extension[ \t]*=)/;\1/' "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini"

You can re-enable it at a later time by removing the ; character, for example with:

sed -Ei 's/^[ \t]*;[ \t]*((zend_)?extension[ \t]*=)/\1/' "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini"

Here's a sample session:

$ cat "$PHP_INI_DIR/conf.d/docker…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mlocati
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #600 on June 17, 2022 12:50.