I have a fresh dockerized Symfony project. The problem I’m facing is that I’m unable to run console commands.
So what I did so far:
I installed security bundle: composer require symfony/security-bundle
I installed console: composer require symfony/console
When I run symfony
it gives me the list of possible commands to be used including console.
But then when I run symfony console
I get this: No Symfony console detected to run “symfony console”
Tried to run php bin/console
and php app/console
but that gave me the following: Could not open input file: bin/console
I don’t have a deep understanding of Symfony, so possibly the issue is something silly.
Thanks.
Here is the Dockerfile:
FROM php:8.1-apache
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN apt-get update
&& apt-get install -qq -y --no-install-recommends
cron
vim
locales coreutils apt-utils git libicu-dev g++ libpng-dev libxml2-dev libzip-dev
libonig-dev libxslt-dev;
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen &&
echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen &&
locale-gen
RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls &&
mv composer.phar /usr/local/bin/composer
RUN docker-php-ext-configure intl
RUN docker-php-ext-install pdo pdo_mysql mysqli gd opcache intl zip calendar dom
mbstring zip gd xsl && a2enmod rewrite
RUN pecl install apcu && docker-php-ext-enable apcu
ADD https://github.com/mlocati/docker-php-extension-
installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && sync &&
install-php-extensions amqp
WORKDIR /var/www