Whoops, looks like something went wrong.
Loading...
Lynx2008 avatar Lynx2008 7 Точки

phpstorm не отваря проект

Здравейте колеги, моля помагайте.

Не успявам вече дни да подкарам PHP-то, нито на настолният, нито на лаптопа, грешки след грешки изписва.

Не ми тръгва дори готов проект от exam-preps. 

Tекущо като заредя например кой да е изпит от майският модул, като IMDB или project rider дава това:

Fatal error: Uncaught Error: Class 'Symfony\Bundle\FrameworkBundle\Controller\Controller' not found in C:\Projects\PHP\src\AppBundle\Controller\FilmController.php:11 Stack trace: #0 {main} thrown in C:\Projects\PHP\src\AppBundle\Controller\FilmController.php on line 11

Какво да направя за да го стартирам ?

При останалите технологии всичко си работи от първият път.

Тагове:
dimaldim92 avatar dimaldim92 149 Точки

Като изтегли проекта написа ли composer install в директорията му ?

0
Lynx2008 avatar Lynx2008 7 Точки

Написах, инсталира се.

0
dimaldim92 avatar dimaldim92 149 Точки

Къде ти дава тази грешка? Сега пробвах с project rider и phpstorm-а ми го зарежда без проблем.

0
Lynx2008 avatar Lynx2008 7 Точки

След като заредя проекта и натисна горе в дясно бутон на браузъра ми дава горепосоченото. 

Като проекта е в C:\Projects\PHP и съм се погрижил да няма никакви точки и съмволи и да е кратък пътя. 

0
dimaldim92 avatar dimaldim92 149 Точки

Няма да ти го зареди така. В конзолата пишеш php bin/console server:run , ако искаш да ползваш вграденият дев сървър, ще ти го пусне на 127.0.0.1:8000 , другия вариант е да си настроиш xampp.

0
Lynx2008 avatar Lynx2008 7 Точки

C:\Projects\PHP>php bin/console server:run


  [Symfony\Component\Debug\Exception\ContextErrorException]
  Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
 

След това изписа това:

C:\Projects\PHP>php bin/console server:run

 [OK] Server listening on http://127.0.0.1:8000

 // Quit the server with CONTROL-C.
 

А na localhost:8000 дава това:

Whoops, looks like something went wrong.

(2/2) ContextErrorException

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

in UnitOfWork.php (line 2718)
at ErrorHandler->handleError(2, '"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?', 'C:\\Projects\\PHP\\vendor\\doctrine\\orm\\lib\\Doctrine\\ORM\\UnitOfWork.php', 2718, array('file' => 'C:\\Projects\\PHP\\vendor\\composer/../doctrine/orm/lib/Doctrine/ORM\\UnitOfWork.php'))in ClassLoader.php (line 444)
at include()in ClassLoader.php (line 444)
at Composer\Autoload\includeFile('C:\\Projects\\PHP\\vendor\\composer/../doctrine/orm/lib/Doctrine/ORM\\UnitOfWork.php')in ClassLoader.php (line 322)
at ClassLoader->loadClass('Doctrine\\ORM\\UnitOfWork')
at call_user_func(array(object(ClassLoader), 'loadClass'), 'Doctrine\\ORM\\UnitOfWork')in DebugClassLoader.php (line 144)
at DebugClassLoader->loadClass('Doctrine\\ORM\\UnitOfWork')
at spl_autoload_call('Doctrine\\ORM\\UnitOfWork')in EntityManager.php (line 162)
at EntityManager->__construct(object(Connection), object(Configuration), object(ContainerAwareEventManager))in EntityManager.php (line 850)
at EntityManager::create(object(Connection), object(Configuration))in appDevDebugProjectContainer.php (line 1054)
at appDevDebugProjectContainer->getDoctrine_Orm_DefaultEntityManagerService()in Container.php (line 329)
at Container->get('doctrine.orm.default_entity_manager')in ManagerRegistry.php (line 34)
at ManagerRegistry->getService('doctrine.orm.default_entity_manager')in AbstractManagerRegistry.php (line 200)
at AbstractManagerRegistry->getManagers()in DoctrineDataCollector.php (line 61)
at DoctrineDataCollector->collect(object(Request), object(Response), object(ContextErrorException))in Profiler.php (line 164)
at Profiler->collect(object(Request), object(Response), object(ContextErrorException))in ProfilerListener.php (line 91)
at ProfilerListener->onKernelResponse(object(FilterResponseEvent), 'kernel.response', object(TraceableEventDispatcher))
at call_user_func(array(object(ProfilerListener), 'onKernelResponse'), object(FilterResponseEvent), 'kernel.response', object(TraceableEventDispatcher))in WrappedListener.php (line 104)
at WrappedListener->__invoke(object(FilterResponseEvent), 'kernel.response', object(ContainerAwareEventDispatcher))
at call_user_func(object(WrappedListener), object(FilterResponseEvent), 'kernel.response', object(ContainerAwareEventDispatcher))in EventDispatcher.php (line 212)
at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener),object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.response',object(FilterResponseEvent))in EventDispatcher.php (line 44)
at EventDispatcher->dispatch('kernel.response', object(FilterResponseEvent))in TraceableEventDispatcher.php (line 139)
at TraceableEventDispatcher->dispatch('kernel.response', object(FilterResponseEvent))in HttpKernel.php (line 191)
at HttpKernel->filterResponse(object(Response), object(Request), 2)in HttpKernel.php (line 173)
at HttpKernel->handleRaw(object(Request), 2)in HttpKernel.php (line 68)
at HttpKernel->handle(object(Request), 2, false)in ExceptionListener.php (line 55)
at ExceptionListener->onKernelException(object(GetResponseForExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher))
at call_user_func(array(object(ExceptionListener), 'onKernelException'), object(GetResponseForExceptionEvent), 'kernel.exception',object(TraceableEventDispatcher))in WrappedListener.php (line 104)
at WrappedListener->__invoke(object(GetResponseForExceptionEvent), 'kernel.exception', object(ContainerAwareEventDispatcher))
at call_user_func(object(WrappedListener), object(GetResponseForExceptionEvent), 'kernel.exception', object(ContainerAwareEventDispatcher))in EventDispatcher.php (line 212)
at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(GetResponseForExceptionEvent))in EventDispatcher.php (line 44)
at EventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent))in TraceableEventDispatcher.php (line 139)
at TraceableEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent))in HttpKernel.php (line 228)
at HttpKernel->handleException(object(ContextErrorException), object(Request), 1)in HttpKernel.php (line 79)
at HttpKernel->handle(object(Request), 1, true)in Kernel.php (line 169)
at Kernel->handle(object(Request))in app_dev.php (line 29)
at require('C:\\Projects\\PHP\\web\\app_dev.php')in router.php (line 42)

(1/2) ContextErrorException

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

in UnitOfWork.php (line 2718)
at ErrorHandler->handleError(2, '"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?', 'C:\\Projects\\PHP\\vendor\\doctrine\\orm\\lib\\Doctrine\\ORM\\UnitOfWork.php', 2718, array('class' => 'Doctrine\\ORM\\UnitOfWork', 'file' => 'C:\\Projects\\PHP\\vendor\\composer/../doctrine/orm/lib/Doctrine/ORM\\UnitOfWork.php'))in DebugClassLoader.php (line 141)
at require()in DebugClassLoader.php (line 141)
at DebugClassLoader->loadClass('Doctrine\\ORM\\UnitOfWork')
at spl_autoload_call('Doctrine\\ORM\\UnitOfWork')in EntityManager.php (line 162)
at EntityManager->__construct(object(Connection), object(Configuration), object(ContainerAwareEventManager))in EntityManager.php (line 850)
at EntityManager::create(object(Connection), object(Configuration))in appDevDebugProjectContainer.php (line 1054)
at appDevDebugProjectContainer->getDoctrine_Orm_DefaultEntityManagerService()in Container.php (line 329)
at Container->get('doctrine.orm.default_entity_manager')in ManagerRegistry.php (line 34)
at ManagerRegistry->getService('doctrine.orm.default_entity_manager')in AbstractManagerRegistry.php (line 150)
at AbstractManagerRegistry->getManager('default')in AbstractManagerRegistry.php (line 211)
at AbstractManagerRegistry->getRepository('AppBundle\\Entity\\Film')in FilmController.php (line 20)
at FilmController->index(object(Request))in HttpKernel.php (line 151)
at HttpKernel->handleRaw(object(Request), 1)in HttpKernel.php (line 68)
at HttpKernel->handle(object(Request), 1, true)in Kernel.php (line 169)
at Kernel->handle(object(Request))in app_dev.php (line 29)
at require('C:\\Projects\\PHP\\web\\app_dev.php')in router.php (line 42)
0
09/01/2019 15:57:42
dimaldim92 avatar dimaldim92 149 Точки

Изтрий всички файлове, изтегли наново, дай composer install и пробвай пак.

0
Lynx2008 avatar Lynx2008 7 Точки

Нищо не се променя. И симфонито преинсталирах, пак не иска.

На лаптопа дори и composera не сработва:

'composer' is not recognized as an internal or external command,
operable program or batch file.
 

0
dimaldim92 avatar dimaldim92 149 Точки

Тази грешка и с двата проекта ли ти излиза? 

 

А за composer-a на лаптопа - не си го инсталирал. Ако пък си го инсталирал туко що, затвори конзолата и я отвори пак.

0
Lynx2008 avatar Lynx2008 7 Точки

Най-накрая тръгна. Проблема обаче не ми е ясен и ще го науча в по-късен етап.

Проекта не искаше да се стартира след composer install и след composer update. Настройките в enviromental variables също ги бях оправил, обаче и от тях не беше. Преинсталирането на symfony също не помогна.

Ето тук Наков дава добри обяснения: https://www.youtube.com/watch?time_continue=47&v=RG7PLoS1yyw на 15тата минута с файла init-db.bat

Стартирах го, рефреш на браузъра и започна да работи.

 

 

0