Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

385
Visualizações
Symfony 5.3 The parameter "21" must be defined

i developed a symfony project. Everything words fine on dev machines (using symfony server on port 8000).

When i clone the git in my production server i got this error:

Executing script cache:clear [KO] [KO] Script cache:clear returned with error code 1 !! !! // Clearing the cache for the prod environment with debug !! // false !! !! !! In App_KernelProdContainer.php line 674: !! !! The parameter "21" must be defined. !! !! !! cache:clear [--no-warmup] [--no-optional-warmers] !! !! Script @auto-scripts was called via post-update-cmd

I tried to: delete the var/cache/* content execute a php bin/console cache:pool:clear cache.global_clearer set the env to prod and to dev

Nothing changes.

I have an ubuntu 20 with php-fpm7.4, mysql 8.0.

The error log shows:

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The parameter "21" must be defined. in /var/www/html/lavanderiasolari/public_html/laundry_manager/var/cache/prod/ContainerJ6TfZkC/App_KernelProdContainer.php:674\nStack trace:\n#0 /var/www/html/lavanderiasolari/public_html/laundry_manager/vendor/symfony/dependency-injection/EnvVarProcessor.php(281): ContainerJ6TfZkC\App_KernelProdContainer->getParameter()\n#1 [internal function]: Symfony\Component\DependencyInjection\EnvVarProcessor->Symfony\Component\DependencyInjection\{closure}()\n#2 /var/www/html/lavanderiasolari/public_html/laundry_manager/vendor/symfony/dependency-injection/EnvVarProcessor.php(277): preg_replace_callback()\n#3 /var/www/html/lavanderiasolari/public_html/laundry_manager/vendor/symfony/dependency-injection/Container.php(415): Symfony\Component\DependencyInjection\EnvVarProcessor->getEnv()\n#4 /var/www/html/lavanderiasolari/public_html/laundry_manager/var/cache/prod/Contai...'

I executed composer dump-env .env and he generated .env.local.php, with

return array ( 'APP_ENV' => 'prod', 'APP_SECRET' => 'c6e083dd648f30951fb991cee1df42f9', 'DATABASE_URL' => 'mysql://[DBUSER]:'.urlencode('[dbpasswd]').'@127.0.0.1:3306/[dbname]?serverVersion=8.0', );

What shall i do?

Thanks a lot.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Having the same error. The problem is comming from special characters in your password. Indeed in .env variables you need to url encode. For example != become %21%2F but it cause error

The parameter “21” must be defined

Solution in config/packages/doctrine.yaml replace

url: '%env(resolve:DATABASE_URL)%'

by

url: '%env(DATABASE_URL)%'
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda