-
Hello, first of all... Thank you very much for this wonderful package. This made install extensions in my docker containers a breeze and I cant live without it. I dont think this is a feature request, other than just a simple question... Is there a way to uninstall a package? Let me say it like this... Usually I have a base image for every project, but on some I dont need an already installed package and I just unsinstall it through PECL. If you have a simple way I would take it in no time... Thank you again |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Let's say that you have installed the GD extension. rm "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini" If you'd like to disable it temporarily, you can simply prepend a 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 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-php-ext-gd.ini"
extension=gd.so
$ php -r 'var_dump(extension_loaded("gd"));'
bool(true)
$ sed -Ei 's/^([ \t]*(zend_)?extension[ \t]*=)/;\1/' "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini"
$ cat "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini"
;extension=gd.so
$ php -r 'var_dump(extension_loaded("gd"));'
bool(false)
$ sed -Ei 's/^[ \t]*;[ \t]*((zend_)?extension[ \t]*=)/\1/' "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini"
$ cat "$PHP_INI_DIR/conf.d/docker-php-ext-gd.ini"
extension=gd.so
$ php -r 'var_dump(extension_loaded("gd"));'
bool(true) |
Beta Was this translation helpful? Give feedback.
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 theextension=
(orzend_extension=
) directive.This can be done with this command:
You can re-enable it at a later time by removing the
;
character, for example with:Here's a sample session:
$ cat "$PHP_INI_DIR/conf.d/docker…