symfony 3 프로젝트에 대한 SMTP를 platform.sh에 구성하려고했지만 작동하지 않았습니다.symfony 3 프로젝트에 대해 platform.sh에서 smtp 구성
나는이 문서 [https://docs.platform.sh/administration/web/email.html#sending-e-mail][1].
parameters.yml은 빌드 프로세스 중에 생성되므로 편집 할 수 없습니다. 그래서 paramters.yml.dist를 편집하려고했습니다. 그리고이 코드로 updatet :
mailer_transport: smtp
mailer_host: "%env(PLATFORM_SMTP_HOST)%"
mailer_user: null
mailer_password: null
나는 내가 빌드하는 동안 다음과 같은 오류 메시지가 나타납니다 않는 경우 :
W: [RuntimeException]
W: An error occurred when executing the "'cache:clear --no-warmup'" command:
W:
W: [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
W: You have requested a non-existent parameter "env(platform_smtp_host)".
그래서 내가 paramters_platform.php을 편집하려고 다음과 같은 코드를 추가 :
를
$container->setParameter('mailer_host','%env(PLATFORM_SMTP_HOST)%');
그런 다음 빌드 프로세스가 작동하지만 내가 웹 사이트로드 다음과 같은 오류 메시지가 얻을 :
을ParameterNotFoundException in ParameterBag.php line 84:
You have requested a non-existent parameter "env(platform_smtp_host)".
in ParameterBag.php line 84
at ParameterBag->get('env(platform_smtp_host)') in ParameterBag.php line 200
at ParameterBag->resolveString('%env(PLATFORM_SMTP_HOST)%', array('mailer_host' => true, 'env(platform_smtp_host)' => true)) in ParameterBag.php line 171
at ParameterBag->resolveValue('%env(PLATFORM_SMTP_HOST)%', array('mailer_host' => true)) in ParameterBag.php line 200
at ParameterBag->resolveString('%mailer_host%', array('mailer_host' => true)) in ParameterBag.php line 171
at ParameterBag->resolveValue('%mailer_host%', array()) in ParameterBag.php line 161
at ParameterBag->resolveValue(array('transport' => '%mailer_transport%', 'host' => '%mailer_host%', 'username' => '%mailer_user%', 'password' => '%mailer_password%'), array()) in ParameterBag.php line 161
at ParameterBag->resolveValue(array(array('transport' => '%mailer_transport%', 'host' => '%mailer_host%', 'username' => '%mailer_user%', 'password' => '%mailer_password%'))) in MergeExtensionConfigurationPass.php line 45
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in Compiler.php line 104
at Compiler->compile(object(ContainerBuilder)) in ContainerBuilder.php line 597
at ContainerBuilder->compile() in bootstrap.php.cache line 2687
at Kernel->initializeContainer() in bootstrap.php.cache line 2465
at Kernel->boot() in bootstrap.php.cache line 2496
at Kernel->handle(object(Request)) in app_dev.php line 30
누구든지 SMTP가 plaform.sh에서 작동하도록 관리 했습니까? 아니면 누구든지이 문제를 없애는 방법을 알고 있습니까?
대단히 감사합니다!
: http://symfony.com/doc/3.3/configuration/external_parameters.html 의 GetEnv() : 외부 매개 변수를 설정
:
일부 기사 :이 파일은 단지
getenv()
PHP 함수를 이용하여 필요한 컨테이너 매개 변수를 설정 내부 2.8 프로젝트의 컨테이너이며 항상 잘 작동했습니다. – dlondero