저와 팀은 비교적 큰 Symfony 프로젝트를 진행하고 있습니다. 우리는 모든 Windows PC에서 XAMPP를 사용하여 로컬에서 작업 해 왔으며 거의 오류가 발생하지 않았습니다. 최근에 나는 리눅스 (CrunchBang 리눅스)에서 애플리케이션을 테스트하는 작업을 맡았고 꽤 심각한 오류가 발생했습니다. 나는 모든 StackOverflow를 살펴 보았고 내가 찾을 수있는 모든 것을 시도했습니다.
App.php (localhost /)는 빈 화면을 반환합니다. App_dev.php (localhost / app_dev.php)는 다음 두 가지 오류를 제공합니다.
1/2 ResourceNotFoundException :
in /home/tim/web/grip.dev/app/cache/dev/appDevUrlMatcher.php line 136
at appDevUrlMatcher->match('/') in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1207
at Router->match('/') in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1872
at RouterListener->onKernelRequest(object(GetResponseEvent))
at call_user_func(array(object(RouterListener), 'onKernelRequest'), object(GetResponseEvent)) in /home/tim/web/grip.dev/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 450
at TraceableEventDispatcher->Symfony\Component\HttpKernel\Debug\{closure}(object(GetResponseEvent))
at call_user_func(object(Closure), object(GetResponseEvent)) in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1667
at EventDispatcher->doDispatch(array(object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure)), 'kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1600
at EventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1764
at ContainerAwareEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 139
at TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2833
at HttpKernel->handleRaw(object(Request), '1') in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2818
at HttpKernel->handle(object(Request), '1', true) in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2947
at ContainerAwareHttpKernel->handle(object(Request), '1', true) in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2249
at Kernel->handle(object(Request)) in /home/tim/web/grip.dev/web/app_dev.php line 28
2/2 NotFoundHttpException : "GET /"에 대한 경로를 찾을 수 없습니다.
in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1883
at RouterListener->onKernelRequest(object(GetResponseEvent))
at call_user_func(array(object(RouterListener), 'onKernelRequest'), object(GetResponseEvent)) in /home/tim/web/grip.dev/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 450
at TraceableEventDispatcher->Symfony\Component\HttpKernel\Debug\{closure}(object(GetResponseEvent))
at call_user_func(object(Closure), object(GetResponseEvent)) in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1667
at EventDispatcher->doDispatch(array(object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure)), 'kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1600
at EventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/app/cache/dev/classes.php line 1764
at ContainerAwareEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 139
at TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent)) in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2833
at HttpKernel->handleRaw(object(Request), '1') in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2818
at HttpKernel->handle(object(Request), '1', true) in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2947
at ContainerAwareHttpKernel->handle(object(Request), '1', true) in /home/tim/web/grip.dev/app/bootstrap.php.cache line 2249
at Kernel->handle(object(Request)) in /home/tim/web/grip.dev/web/app_dev.php line 28
호출 php app/console router:debug
하면 다음을 반환합니다.
[router] Current routes
Name Method Scheme Host Path
_wdt ANY ANY ANY /_wdt/{token}
_profiler_home ANY ANY ANY /_profiler/
_profiler_search ANY ANY ANY /_profiler/search
_profiler_search_bar ANY ANY ANY /_profiler/search_bar
_profiler_purge ANY ANY ANY /_profiler/purge
_profiler_info ANY ANY ANY /_profiler/info/{about}
_profiler_import ANY ANY ANY /_profiler/import
_profiler_export ANY ANY ANY /_profiler/export/{token}.txt
_profiler_phpinfo ANY ANY ANY /_profiler/phpinfo
_profiler_search_results ANY ANY ANY /_profiler/{token}/search/results
_profiler ANY ANY ANY /_profiler/{token}
_profiler_router ANY ANY ANY /_profiler/{token}/router
_profiler_exception ANY ANY ANY /_profiler/{token}/exception
_profiler_exception_css ANY ANY ANY /_profiler/{token}/exception.css
_configurator_home ANY ANY ANY /_configurator/
_configurator_step ANY ANY ANY /_configurator/step/{index}
_configurator_final ANY ANY ANY /_configurator/final
모든 라우팅은 XAMPP를 사용하는 Windows에서 작동합니다.
어떻게 든 내 apache2 구성과 관련이 있다고 생각합니다. 모드 재 작성을 설정했으며 web/.htaccess
RewriteEngine On을 사용합니다. 내 vHost도 'AllowOverride All'로 구성됩니다. 내가 찾은 것 외에는 apache2를 수동으로 구성하는 데 많은 경험이 없습니다.
내 PHP 버전은 5.4.4-14 + deb7u5 입니다.
편집 : 라우팅을 사용자 지정 라우팅 파일로 리디렉션합니다 : (app / config / config.yml)
framework:
router:
resource: "@CoreBundle/Resources/config/routing.php"
다음은 routing.php입니다.
<?php
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;
$collection = new RouteCollection();
//Routes for other bundles go here
/*
* Route format for other bundles.
* -------------------------------
* $<bundlename>Routing = $loader->import("@<bundlenamespace>/Resources/config/routing.php");
* $<bundlename>Routing->addPrefix('<Insert bundle prefix>');
* $collection->addCollection($<bundlename>Routing);
* -------------------------------
* Add a whiteline in between each bundle route.
*/
$gripRouting = $loader->import("@GripBundle/Resources/config/routing.php");
$gripRouting->addPrefix('/grip');
$collection->addCollection($gripRouting);
$ddsRouting = $loader->import("@DDSBundle/Resources/config/routing.php");
$ddsRouting->addPrefix('/dds');
$collection->addCollection($ddsRouting);
//Routes for the core bundle go here
$collection->add('login', new Route('/login', array(
'_controller' => 'CoreBundle:Login:login',
)));
$collection->add('login_check', new Route('/login_check', array()));
$collection->add('core_logout', new Route('/logout', array()));
$collection->add('products', new Route('/products', array(
"_controller" => "CoreBundle:Default:products",
)));
$collection->add('about', new Route('/about', array(
"_controller" => "CoreBundle:Default:about",
)));
$collection->add('contact', new Route('/contact', array(
"_controller" => "CoreBundle:Default:contact",
)));
$collection->add('core_noclient', new Route("/error", array(
"_controller" => "CoreBundle:Default:noClient",
)));
// Vendor bundles
$securityCollection = $loader->import("@FOSUserBundle/Resources/config/routing/security.xml");
$collection->addCollection($securityCollection);
$profileCollection = $loader->import("@FOSUserBundle/Resources/config/routing/profile.xml");
$profileCollection->addPrefix("/profile");
$collection->addCollection($profileCollection);
$registrationCollection = $loader->import("@FOSUserBundle/Resources/config/routing/registration.xml");
$registrationCollection->addPrefix("/register");
$collection->addCollection($registrationCollection);
$resettingCollection = $loader->import("@FOSUserBundle/Resources/config/routing/resetting.xml");
$resettingCollection->addPrefix("/resetting");
$collection->addCollection($resettingCollection);
$changePasswordCollection = $loader->import("@FOSUserBundle/Resources/config/routing/change_password.xml");
$changePasswordCollection->addPrefix("/profile");
$collection->addCollection($changePasswordCollection);
$gripRouting = $loader->import("@SonataAdminBundle/Resources/config/routing/sonata_admin.xml");
$gripRouting->addPrefix('/admin');
$collection->addCollection($gripRouting);
$gripRouting = $loader->import(".", "sonata_admin");
$gripRouting->addPrefix('/admin');
$collection->addCollection($gripRouting);
$gripRouting = $loader->import("@SonataUserBundle/Resources/config/routing/admin_security.xml");
$gripRouting->addPrefix('/admin');
$collection->addCollection($gripRouting);
$collection->add('core_home', new Route('/', array(
'_controller' => 'CoreBundle:Default:index',
)));
return $collection;
나는 그것을 고쳤다. 나는 실제로 무슨 일이 일어 났는지에 대해 여전히 파란색에 있지만 PHP-APC와 내 캐시 모두에 의해 발생한 것 같습니다. 캐시를 지우고 폴더의 내용을 제거한 다음 setfacl을 사용하여 권한을 다시 설정했습니다. 또한 composer를 사용하여 업데이트하여 parameters.yml을 적절한 설정으로 새로 고칠 수 있습니다.
이 작은 '포인터'로 누군가를 돕길 바랍니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다