2017-10-01 11 views
0

MacOS에서 PHP 개발 서버를 실행할 때 작곡가에게 다음과 같은 오류가 나타납니다.작곡가 치명적인 오류 : composerRequire를 다시 선언 할 수 없습니다.

그러나 내 Windows 상자에 똑같은 코드를 실행하면 모든 것이 완벽하게 실행되는 것처럼 보입니다. 나는 autoload에 대한 require 문을 두 번 이상 포함하지 않는다는 것을 확인했다. 무엇이 이것을 일으킬 수 있습니까? 차이가 있다면 HomeBrew의 작곡가를 사용하고 있습니다. 나는 그와 같은 특정 파일 네임 스페이스가 여러 번 포함될 수 있음을 알 수 없다.

편집

작곡가 autoload_real.php

<?php 

// autoload_real.php @generated by Composer 

class ComposerAutoloaderInit01a3dc0b1f885ed2b645be37711584c1 
{ 
    private static $loader; 

    public static function loadClassLoader($class) 
    { 
     if ('Composer\Autoload\ClassLoader' === $class) { 
      require __DIR__ . '/ClassLoader.php'; 
     } 
    } 

    public static function getLoader() 
    { 
     if (null !== self::$loader) { 
      return self::$loader; 
     } 

     spl_autoload_register(array('ComposerAutoloaderInit01a3dc0b1f885ed2b645be37711584c1', 'loadClassLoader'), true, true); 
     self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 
     spl_autoload_unregister(array('ComposerAutoloaderInit01a3dc0b1f885ed2b645be37711584c1', 'loadClassLoader')); 

     $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 
     if ($useStaticLoader) { 
      require_once __DIR__ . '/autoload_static.php'; 

      call_user_func(\Composer\Autoload\ComposerStaticInit01a3dc0b1f885ed2b645be37711584c1::getInitializer($loader)); 
     } else { 
      $map = require __DIR__ . '/autoload_namespaces.php'; 
      foreach ($map as $namespace => $path) { 
       $loader->set($namespace, $path); 
      } 

      $map = require __DIR__ . '/autoload_psr4.php'; 
      foreach ($map as $namespace => $path) { 
       $loader->setPsr4($namespace, $path); 
      } 

      $classMap = require __DIR__ . '/autoload_classmap.php'; 
      if ($classMap) { 
       $loader->addClassMap($classMap); 
      } 
     } 

     $loader->register(true); 

     if ($useStaticLoader) { 
      $includeFiles = Composer\Autoload\ComposerStaticInit01a3dc0b1f885ed2b645be37711584c1::$files; 
     } else { 
      $includeFiles = require __DIR__ . '/autoload_files.php'; 
     } 
     foreach ($includeFiles as $fileIdentifier => $file) { 
      composerRequire01a3dc0b1f885ed2b645be37711584c1($fileIdentifier, $file); 
     } 

     return $loader; 
    } 
} 

function composerRequire01a3dc0b1f885ed2b645be37711584c1($fileIdentifier, $file) 
{ 
    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 
     require $file; 

     $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 
    } 
} 
+0

작곡가가 생성 한'/ vendor/composer/autoload_real.php' 파일을 붙여 넣을 수 있습니까? – Federkun

+0

@Federkun이 추가됨 – Xenology

+0

왜 클래스 및 함수 이름이 tho입니까? –

답변

0

당신이 기존 프로젝트 디렉토리의 사본을 만들어

시도 composer.lock을 삭제하는 새로운 디렉토리에 TUN하려고 보인다 및 vendor/ 및 실행 composer update

100 % 확신 할 수는 없지만 도움이되기를 바랍니다.