2016-07-29 6 views
1

私はステージング環境(uat)をセットアップしました。その目的は、すべての電子メールを単一の電子メールアドレスまたは最悪の場合電子メール機能を無効にすることです。 私の問題は、以下の設定にもかかわらず、アプリケーションはまだ環境を改善する必要があるので電子メールを送信していることです。Swiftmailerは引き続きdisable_deliveryまたはdelivery_addressにもかかわらず電子メールを送信します

# config_uat.yml 
imports: 
    - { resource: config.yml } 

monolog: 
    handlers: 
     main: 
      type:   fingers_crossed 
      action_level: error 
      handler:  nested 
     nested: 
      type: stream 
      path: "%kernel.logs_dir%/%kernel.environment%.log" 
      level: debug 

swiftmailer: 
    transport:  smtp 
    host:   127.0.0.1 
    port:   25 
    encryption:  null 
    sender_address: [email protected] 
    logging:  "%kernel.debug%" 
    delivery_address: '[email protected]' 
    disable_delivery: true 

そして:

#config.yml 
imports: 
    - { resource: parameters.yml } 
    - { resource: security.yml } 
    - { resource: "@psmdbBundle/Resources/config/services.yml" } 
    - { resource: "@psmdbBundle/Resources/config/version.yml" } 

# Swiftmailer Configuration 
swiftmailer: 
    transport:  smtp 
    host:   127.0.0.1 
    port:   25 
    encryption:  null 
    sender_address: [email protected] 
    logging:  "%kernel.debug%" 

[EDIT]

私はセットアップapp_uat.phpを持っています。これは、app.phpに基づいています。

<?php 

use Symfony\Component\ClassLoader\ApcClassLoader; 
use Symfony\Component\HttpFoundation\Request; 

$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; 

// Use APC for autoloading to improve performance. 
// Change 'sf2' to a unique prefix in order to prevent cache key conflicts 
// with other applications also using APC. 
/* 
$loader = new ApcClassLoader('sf2', $loader); 
$loader->register(true); 
*/ 

//require_once __DIR__.'/../app/AppKernel.php'; 
//require_once __DIR__.'/../app/AppCache.php'; 

$kernel = new AppKernel('uat', false); 
$kernel->loadClassCache(); 
//$kernel = new AppCache($kernel); 
$request = Request::createFromGlobals(); 
$response = $kernel->handle($request); 
$response->send(); 
$kernel->terminate($request, $response); 

[EDIT 2] 私がチェックしているとprod環境ではなく、UATの実行されています。 私はUATを実行するために、セットアップに私のApacheの設定を管理することはできません...ここにある:

<VirtualHost *:80> 
    ServerName uat.gpsc.domain.com 

    DocumentRoot /var/www/vhosts/uat.gpsc.domain.com/current/web 
    <Directory /var/www/vhosts/uat.gpsc.domain.com/current/web> 
     AllowOverride All 
     Require all granted 
     Allow from All 

     <IfModule mod_rewrite.c> 
      Options -MultiViews 
      RewriteEngine On 
      RewriteCond %{REQUEST_FILENAME} !-f 
      RewriteRule ^(.*)$ app_uat.php [QSA,L] 
     </IfModule> 

    </Directory> 

    ErrorLog /var/log/apache2/uat.project_error.log 
    CustomLog /var/log/apache2/uat.project_access.log combined 

</VirtualHost> 

答えて

1

あなたはapp_uat.phpを通じてサイトにアクセスしていますか? (ウェブディレクトリに新しいフロントコントローラファイル、あなたが作成しているはずです)、そのファイルには、ユーザーが設定しておく必要があります。

$kernel = new AppKernel('uat', true);//or 'uat', false 

をこれがhttp://symfony.com/doc/current/configuration/environments.html

に記載されたプロセスであるあなたとあなたの答えを更新してくださいapp_uat.phpを作成していればそれです。


EDIT:これはあなたのapp_uatファイルが正しいようですので、あなたは、Apacheのを設定した方法に問題です。しかし、誰かがそれを必要とする場合に備えて、前の部分を残しておきます(これは良い最初のステップです)。

あなたのApache設定ファイルを見ると、すべてがうまく表示されます。しかし、また確認してください。

  1. はライン<IfModule mod_rewrite.c>とその終了タグを削除...だからは上の書き換えモジュールを持っていることを余儀なくしています! sudo a2enmod rewriteは、Apacheの書き換えモジュールを有効にします。

  2. は、Apache sudo service apache2 restart

  3. AllowOverride Allを再起動するようにすると、任意のhtaccessのファイルが動作をオーバーライドできることを意味していることを確認します。これが起こっていないことを確認してください。はい、私はapp_uat.phpを持っていると私は、このフロントコントローラを介してアプリケーションにアクセスしていますが

+0

ls -aを行うことによって、symfonyのルートフォルダ、またはそのウェブフォルダ内のすべての隠しファイルを表示します。 – curuba

+0

質問を更新していただきありがとうございます。あなたの問題は間違いなくApacheにあります。私はそれに応じて答えを編集しました。 – galeaspablo

+0

あなたが提案したように、この問題はAllowOverride AllとSymfonyフレームワークが提供するデフォルトの.htaccessに関連していました。 – curuba

関連する問題