2016-07-11 5 views
0

フォームは、サーバーがSymfony 2.7がリクエストを処理できないという点を除いて、異なる役割とアクセス許可で表示されますなぜ !!)。Symfony 2.7:127.0.0.1ページが機能しない127.0.0.1は現在このリクエストを処理できません

127.0.0.1ページが機能していません 127.0.0.1は現在このリクエストを処理できません。ここで

Class RoleType{ 
public function buildForm(FormBuilderInterface $builder, array $options) 
    { 
     $builder 

      ->add('groups', 'entity',array(
              'class' => 'GroupsBundle:Roles', 
              'property' => 'name_role', 
              'required' => false, 
              'placeholder' => 'Choisir le role du votre groupe' 
             ) 
      ) 


      ->add('permissions_role','entity',array(
        'class' => 'GroupsBundle:Permissions', 
        'property' => 'name_permissions', 
        'multiple' => true, 
        'expanded' => true, 
        'required' => true 
       ) 
       ) 
; 
} 
} 

Class GroupType{ 



class GroupsType extends AbstractType 
{ 
    /** 
    * @param FormBuilderInterface $builder 
    * @param array $options 
    */ 
    public function buildForm(FormBuilderInterface $builder, array $options) 
    { 
     $builder 
      ->add('image', new ImagesType()) 
      ->add('name_groups','text',array('required' => true, 'attr' => array('placeholder' => 'Nom du groupe'))) 
      ->add('role', new RolesType()) 
     ; 
    } 
} 

コントローラのコード:

public function createAction(Request $request) 
    { 
     $entity = new Groups(); 
     $form = $this->createCreateForm($entity); 
     $form->handleRequest($request); 


     if ($form->isValid()) { 
      $em = $this->getDoctrine()->getManager(); 
      //$em->getReference('MemberShipManagement\GroupsBundle\Entity\Groups',$entity.getId()); 
      $em->persist($entity); 
      $em->flush(); 

      return $this->redirect($this->generateUrl('groups_show', array('id' => $entity->getId()))); 
     } 

     return $this->render('GroupsBundle:Groups:new.html.twig', array(
      'entity' => $entity, 
      'form' => $form->createView(), 
     )); 
    } 

はあなたに感謝し、ここで

php app/console cache:clear --env=prod 

は私にformTypeです:私は、コマンドを使用していても、HTTPエラー500

問題を解決するには

* Dev.log

[2016-07-12 00:23:49] doctrine.DEBUG: SELECT p0_.id_per AS id_per0, p0_.nom_permisions AS nom_permisions1 FROM permissions p0_ [] [] 
[2016-07-12 00:23:49] doctrine.DEBUG: SELECT r0_.id AS id0, r0_.nom_roles AS nom_roles1 FROM roles r0_ WHERE r0_.id IN (?) [["0"]] [] 
[2016-07-12 01:51:58] php.DEBUG: fsockopen(): unable to connect to 127.0.0.1:8000 (Connection refused) {"type":2,"file":"/home/syrine01/Desktop/Project_Console/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"l 
evel":28928} [] 
WARNING - Translation not found. 
Context: {"id":"Image","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
Context: {"id":"File","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
Context: {"id":"Name groups","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
Context: {"id":"Nom du groupe","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
Context: {"id":"Role","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
Context: {"id":"Groups","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
Context: {"id":"Choisir le role du votre groupe","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
Context: {"id":"Permissions role","domain":"messages","locale":"fr"} 
WARNING - Translation not found. 
INFO - Matched route "groups_new". 
Context: {"route_parameters":{"_controller":"MemberShipManagement\\GroupsBundle\\Controller\\GroupsController::newAction","_route":"groups_new"},"request_uri":"http://127.0.0.1:8000/groups/new"} 
DEPRECATED - The Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter class is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead. + 
INFO - Populated the TokenStorage with an anonymous Token. 
DEPRECATED - MemberShipManagement\GroupsBundle\Form\GroupsType: The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. + 
DEPRECATED - MemberShipManagement\GroupsBundle\Form\ImagesType: The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. + 
DEPRECATED - MemberShipManagement\GroupsBundle\Form\RolesType: The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. + 
DEPRECATED - The "property" option is deprecated since version 2.7 and will be removed in 3.0. Use "choice_label" instead. 

私は私のウェブサイト

の翻訳を行っていないコンフィグdatabseは次のとおりです。このコマンドで

doctrine: 
    dbal: 
      driver: pdo_mysql 
      host:  "%database_host%" 
      port:  "%database_port%" 
      dbname: "%database_name%" 
      user:  "%database_user%" 
      password: "%database_password%" 
      charset: UTF8 
      unix_socket: /tmp/mysql.sock 

//parameters 
parameters: 
    database_host: 127.0.0.1 
    database_port: null 
    database_name: symfony 
    database_user: root 
    database_password: root 
    mailer_transport: smtp 
    mailer_host: 127.0.0.1 
    mailer_user: null 
    mailer_password: null 

私は私のサーバーで問題が発生しまし見つける

sudo php app/console server:start -vvv 

[2016-07-12 06:02:10] php.DEBUG:fsockopen():接続できません 127.0.0.1:8000(Connection refused){"type":2、 "file": "/ homeこれは、示されている

+0

私たちはどちらかわからない! PHPログで500エラーを見つけて投稿する必要があります。 – cilefen

+0

私は問題のないページが表示されているため、formualreによるサーバー接続の問題があると思います。 グループ情報を保存すると、この問題が表示されます。名前、役割、選択した役割の権限、ありがとうございました – Cros

答えて

1

/Cros/Desktop/Project_Console/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"level":28928} 3行目でdev.logに:

[2016-07-12 01:51:58] php.DEBUG: fsockopen(): unable to connect to 127.0.0.1:8000 (Connection refused) ... 

データベースの情報をチェックして、アプリ/ configにであなたのパラメータまたは設定ファイルに見ているようにしてくださいすべてのデータベースパラメータが正しく設定されているかどうかを確認します。 現在、database_portは8000に設定されています。値をnullにする必要があります。 とにかくデータベース情報(database_host、database_port、database_user、database_password ...)を確認してみてください。それは問題の可能性があります

+0

コンソールの後にデータベースとテーブルを作成したため、問題が構成パラメータにあるとは思われません。私のフォームでは、データベースの後ろにロールと権限が表示されます。データベースに問題はありません – Cros

+0

問題はコードから来ているということです! – Cros

関連する問題