# Docker-php-ext-install error

**URL:** <https://forums.docker.com/t/docker-php-ext-install-error/131960>\
**Category:** General\
**Tags:** docker\
**Created:** [November 23, 2022, 10:05am UTC](https://forums.docker.com/t/docker-php-ext-install-error/131960 "2022-11-23T10:05:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![inietto](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/inietto/32/32627_2.png) [@inietto](https://forums.docker.com/u/inietto)\
**Post date:** [November 23, 2022, 10:05am UTC](https://forums.docker.com/t/docker-php-ext-install-error/131960/1 "2022-11-23T10:05:49Z")

</div>

I have this docker-compose I’m experimenting with.

```auto
  phpfpm:
      restart: unless-stopped
      build: 
        context: ./docker/php-fpm
        args:
          USER_ID: ${USER_ID}
      environment:
        XDEBUG_MODE: debug
        XDEBUG_CONFIG: client_host=host.docker.internal client_port=9003
      volumes:
        - ./:/var/www
      networks:
        - app-network

```

The PHP Dockerfile:

```nohighlight

ARG USER_ID
ENV USER_ID $USER_ID

RUN apt-get update && apt upgrade -y
RUN pecl install xdebug \
    && docker-php-ext-enable xdebug  

RUN docker-php-ext-install mbstring bcmath cli common curl dev gd intl json mbstring mysql opcache readline xml zip

ENV TZ=Africa/Casablanca
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN adduser --uid ${USER_ID} --ingroup www-data developer --shell /bin/bash

USER developer

WORKDIR /var/www

```

The problem is that the Dockerfile get stuck in `RUN docker-php-ext-install` giving this error :

```auto
failed to solve: executor failed running [/bin/sh -c docker-php-ext-install mbstring xdebug bcmath cli common curl dev gd intl json mbstring mysql opcache readline xml zip]: exit code: 1

```

And when executing `docker-php-ext-install` inside this `phpfpm ` container i got this error :  
`mkdir: cannot create directory '/usr/src/php': Permission denied`

How to solve that?  
so how can I make it run?

Thank you
