{"id":2161,"date":"2022-10-04T18:06:37","date_gmt":"2022-10-04T16:06:37","guid":{"rendered":"https:\/\/www.speich.net\/articles\/?p=2161"},"modified":"2022-10-04T18:06:38","modified_gmt":"2022-10-04T16:06:38","slug":"docker-how-to-install-the-php-enchant-extension","status":"publish","type":"post","link":"https:\/\/www.speich.net\/articles\/en\/2022\/10\/04\/docker-how-to-install-the-php-enchant-extension\/","title":{"rendered":"Docker: How to install the php enchant extension"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If I try to install the php <a rel=\"noreferrer noopener\" href=\"https:\/\/www.php.net\/manual\/en\/intro.enchant.php\" target=\"_blank\">enchant extension<\/a> in the docker image <a href=\"https:\/\/hub.docker.com\/layers\/library\/php\/8.1-fpm\/images\/sha256-4c683559eb3a60fd03b63b4cebb95301a6512c50a783653a5b7b7a9efc619a51?context=explore\" target=\"_blank\" rel=\"noreferrer noopener\">php:8.1-fpm<\/a> with <\/p>\n\n\n\n<pre class=\"wp-block-code language-docker\"><code>RUN docker-php-ext-install enchant<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I get the following error:<\/p>\n\n\n\n<pre class=\"wp-block-code language-docker\"><code>E: Unable to locate package libenchant-2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You need to install the missing enchant library in the dockerfile yourself (along with your wanted spellcheck language, in my case Swiss German):<\/p>\n\n\n\n<pre class=\"wp-block-code language-docker\"><code>RUN apt-get install -y libenchant-2-2 libenchant-2-dev aspell-de hunspell-de-ch \\\n   &amp;&amp; docker-php-ext-install enchant<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If I try to install the php enchant extension in the docker image php:8.1-fpm with RUN docker-php-ext-install enchant I get the following error: E: Unable to locate package libenchant-2 You need to install the missing enchant library in the dockerfile yourself (along with your wanted spellcheck language, in my case Swiss German): RUN apt-get install &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.speich.net\/articles\/en\/2022\/10\/04\/docker-how-to-install-the-php-enchant-extension\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Docker: How to install the php enchant extension&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[309],"class_list":["post-2161","post","type-post","status-publish","format-standard","hentry","category-php","tag-docker","entry"],"_links":{"self":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/comments?post=2161"}],"version-history":[{"count":5,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2161\/revisions"}],"predecessor-version":[{"id":2166,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/posts\/2161\/revisions\/2166"}],"wp:attachment":[{"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/media?parent=2161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/categories?post=2161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.speich.net\/articles\/wp-json\/wp\/v2\/tags?post=2161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}