Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [Symfony2][SF2][SF] Home.pl - jak zawsze same problemy
Forum PHP.pl > Forum > PHP > Frameworki
Fluke
Witam,

Otóż mam niebanalny problem po wrzuceniu aplikacji na serwer. Otóż taki błąd:
  1. Warning: file_get_contents(/home/serwer123456/public_html/vsatrader-statement/app/Resources/views/base.html.twig): failed to open stream: No such file or directory in /vsatrader-statement/vendor/symfony/symfony/src/Symfony/Component/Templating/Storage/FileStorage.php on line 32
  2.  
  3. Warning: filemtime(): stat failed for /home/serwer123456/public_html/vsatrader-statement/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig in /vsatrader-statement/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 166


Nie wiem jakim cudem to się dzieje, gdyż ten plik jest w tym miejscu. To jest pewnie początek błędów ...
Macie jakieś pomysły jak to rozwiązać ? Nie chodzi mi o zmianę serwera (chodź polecałem klientowi).

Pozdrawiam
pitu
Próbowałeś czyścić cache? Ostatnio na Vagrancie miałem ten sam błąd po zmianach, wyczyszczenie cache wystarczyło.

Fluke
Tak, czyściłem i dla prod i dla dev.

Sprawdziłem jedną rzecz, mianowicie chodzi o katalogi:
Ścieżka: /home/serwer123456/public_html/vsatrader-statement/app/Resources/views/base.html.twig nie działa, ale
Ścieżka: /public_html/vsatrader-statement/app/Resources/views/base.html.twig już działa,
teraz pytanie czy jest szansa ustawić ręcznie podstawową ścieżkę w Symfony ?

Cały czas znajduję jakieś nowe błędy ...(oczywiście nie poradziłem sobie z wcześniejszym ale jakoś dziwnym trafem zniknęło...magia)

  1. Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to find file "@WebProfilerBundle/Resources/config/routing/wdt.xml"


Znacie to ?
Pozdrawiam

I znowu nic nie zrobiłem a jednak coś ruszyło...tylko teraz pojawia się inny problem. Wygląda na to jak by serwer nie czytał .htaccess. Mianowicie wchodzę na główną stronę i przekierowuje mnie na stronę logowania tylko, że wyświetla mi się błąd 404 Not Found. Plik .htaccess jest ustawiony default`owo przez Symfony.

Jakieś pomysły jak to rozwiązać ?
Pozdrawiam.
memory
Wrzuć aplikacje najlepiej spakuj w zip i rozpakuj na serwerze. Problemy wynikały pewnie ze złego przerzucenia plików na serwer. Pokaż zawartość .htaccess
Fluke
To jest mój cały .htaccess:

  1. # Use the front controller as index file. It serves as a fallback solution when
  2. # every other rewrite/redirect fails (e.g. in an aliased environment without
  3. # mod_rewrite). Additionally, this reduces the matching process for the
  4. # start page (path "/") because otherwise Apache will apply the rewriting rules
  5. # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
  6. DirectoryIndex app.php
  7.  
  8. <IfModule mod_rewrite.c>
  9. RewriteEngine On
  10.  
  11. # Determine the RewriteBase automatically and set it as environment variable.
  12. # If you are using Apache aliases to do mass virtual hosting or installed the
  13. # project in a subdirectory, the base path will be prepended to allow proper
  14. # resolution of the app.php file and to redirect to the correct URI. It will
  15. # work in environments without path prefix as well, providing a safe, one-size
  16. # fits all solution. But as you do not need it in this case, you can comment
  17. # the following 2 lines to eliminate the overhead.
  18. RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
  19. RewriteRule ^(.*) - [E=BASE:%1]
  20.  
  21. # Sets the HTTP_AUTHORIZATION header removed by apache
  22. RewriteCond %{HTTP:Authorization} .
  23. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  24.  
  25. # Redirect to URI without front controller to prevent duplicate content
  26. # (with and without `/app.php`). Only do this redirect on the initial
  27. # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
  28. # endless redirect loop (request -> rewrite to front controller ->
  29. # redirect -> request -> ...).
  30. # So in case you get a "too many redirects" error or you always get redirected
  31. # to the start page because your Apache does not expose the REDIRECT_STATUS
  32. # environment variable, you have 2 choices:
  33. # - disable this feature by commenting the following 2 lines or
  34. # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
  35. # following RewriteCond (best solution)
  36. #RewriteCond %{ENV:REDIRECT_STATUS} ^$
  37. #RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
  38.  
  39. # If the requested filename exists, simply serve it.
  40. # We only want to let Apache serve files and not directories.
  41. RewriteCond %{REQUEST_FILENAME} -f
  42. RewriteRule .? - [L]
  43.  
  44. # Rewrite all other queries to the front controller.
  45. RewriteRule .? %{ENV:BASE}/app.php [L]
  46. </IfModule>
  47.  
  48. <IfModule !mod_rewrite.c>
  49. <IfModule mod_alias.c>
  50. # When mod_rewrite is not available, we instruct a temporary redirect of
  51. # the start page to the front controller explicitly so that the website
  52. # and the generated links can still be used.
  53. RedirectMatch 302 ^/$ /app.php/
  54. # RedirectTemp cannot be used instead
  55. </IfModule>
  56. </IfModule>


Hej,

Teraz inny mam już problem. Mianowicie chodzi o PHP w wersji 5.4: Parse error: syntax error, unexpected '[' in / Mam tak,

/ <-- katalog główny
/mojastrona <-- katalog w którym mam aplikację
/mojastrona/web <-- w tym katalogu jest plik app.php

W home można ustawić sobie wersję w php w .htaccess. Zrobiłem to tak:
  1. :Location /mojastrona/*.php
  2. Use php54
  3. :Location


Jak w tym katalogu wyświetlę phpinifo() to jest wersja 5.4 ale w katalogu /mojastrona/web już nie. Nie wiem jak zrobić by było dla wszystkich plików, które są również w podkatalogach....
Robiłem również:
- :Location /mojastrona/web/*.php
- :Location /mojastrona/*/*.php

Dodzwonienie się do obsługi zanim ktoś odebrał tel zajęło mi 20 min...i nic nie zdziałali.
Pozdrawiam i dzękuję za wszelką pomoc!
ikssde
W katalogu /mojastrona masz plik .htaccess, zgadza się? Wrzuć do niego taki kod i sprawdź czy działa:

  1. :Location /*.php
  2. Use php54
  3. :Location
Fluke
1) dla mojego katalogu nie działa, ale dla innych działa,
2) jak by działało to nie mogę tak zrobić bo w innym katalogu jest strona, która wywala się jak się zmieni na php 5.4.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.