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

BUG: xdebug can't be install #514

Open
YevheniiVolosiuk opened this issue Jan 18, 2025 · 0 comments
Open

BUG: xdebug can't be install #514

YevheniiVolosiuk opened this issue Jan 18, 2025 · 0 comments
Assignees
Labels
🧐 Bug: Needs Confirmation Something isn't working, but needs to be confirmed by a team member.

Comments

@YevheniiVolosiuk
Copy link

Steps To Reproduce

Open Docker and WSL 2
Install fresh new laravel project
Add to Dockerfile install xdebug RUN install-php-extensions xdebug
Build image
Go to php container and run php -v and look if xdebug in info message or not

Also for check can be run

php -r "printf('xDebug does%s exists.' . PHP_EOL, 
extension_loaded('xdebug') ? '' : 'n\'t');"

Outcome

What did you expect?

xdebug to be installed

What happened instead?

When I run for check if's installed and enebled it return info "xDebug doesn't exists."

Affected Docker Images

I am using FROM serversideup/php:8.4-fpm-nginx-alpine

Anything else?

My Dockerfile

############################################
# Base Image
############################################

# Learn more about the Server Side Up PHP Docker Images at:
# https://serversideup.net/open-source/docker-php/
FROM serversideup/php:8.4-fpm-nginx-alpine AS base

## Uncomment if you need to install additional PHP extensions
# USER root
# RUN install-php-extensions bcmath gd

############################################
# Development Image
############################################
FROM base AS development

# We can pass USER_ID and GROUP_ID as build arguments
# to ensure the www-data user has the same UID and GID
# as the user running Docker.
ARG USER_ID
ARG GROUP_ID

# Switch to root so we can set the user ID and group ID
USER root

RUN install-php-extensions xdebug

# Set the user ID and group ID for www-data
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID  && \
    docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx

# Copy custom xdebug configuration
COPY ./.infrastructure/conf/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

# Drop privileges back to www-data
USER www-data

############################################
# CI image
############################################
FROM base AS ci

# Sometimes CI images need to run as root
# so we set the ROOT user and configure
# the PHP-FPM pool to run as www-data
USER root
RUN echo "user = www-data" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf && \
    echo "group = www-data" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf

############################################
# Production Image
############################################
FROM base AS deploy
COPY --chown=www-data:www-data . /var/www/html

# Create the SQLite directory and set the owner to www-data (remove this if you're not using SQLite)
RUN mkdir -p /var/www/html/.infrastructure/volume_data/sqlite/ && \
    chown -R www-data:www-data /var/www/html/.infrastructure/volume_data/sqlite/

USER www-data

@YevheniiVolosiuk YevheniiVolosiuk added the 🧐 Bug: Needs Confirmation Something isn't working, but needs to be confirmed by a team member. label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧐 Bug: Needs Confirmation Something isn't working, but needs to be confirmed by a team member.
Projects
None yet
Development

No branches or pull requests

2 participants