Reputation: 11
I tried to execute a symfony project within a docker container by "php bin/console server:run " but it generate the following error :
"There are no commands defined in the "server" namespace.
You may be looking for a command provided by the "Debug Bundle" which is currently not installed. Try running "composer require symfony/debug-bundle --dev". ]"
Then i tried to install this package, but the error persist .
And i tried to install symfony/web-server-bundle package
too, but another error display:
"Composer require symfony/web-server-bundle Info from https://repo.packagist.org: #StandWithUkraine ./composer.json has been updated Running composer update symfony/web-server-bundle Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires symfony/web-server-bundle 6.1.*, found symfony/web-server-bundle[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev] but it does not match the constraint. Installation failed, reverting ./composer.json and ./composer.lock to their original content "
Upvotes: 1
Views: 1009
Reputation: 165
The symfony/web-server-bundle is now deprecated.
For a dev environment, you can try installing the Symfony cli https://symfony.com/download. I don't know what docker image you are using, but the doc has instructions for installation on multiple different linux environments.
Then you can use the Symfony local server: https://symfony.com/doc/current/setup/symfony_server.html.
Typically the command to run the server is:
symfony server:start
A side note: when using docker you will also need to expose the port the web server runs the application on if you want to access it.
Upvotes: 1