Note that there are some explanatory texts on larger screens.

plurals
  1. POSilex routing not found
    primarykey
    data
    text
    <p>I'm using Silex for first time. Everything works fine while developing locally. Once uploaded everything to production server, parametrized routes don't work anymore.</p> <p>Do you have any idea?<br> Am I missing production configurations somewhere?<br> Am I missing file permissions somewhere?</p> <p>I'm getting those two exceptions:</p> <pre><code>NotFoundHttpException: No route found for "GET /prevendita/hello/sadfasdf" in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 92 at RouterListener-&gt;onKernelRequest(object(GetResponseEvent)) at call_user_func(array(object(RouterListener), 'onKernelRequest'), object(GetResponseEvent)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 164 at EventDispatcher-&gt;doDispatch(array(array(object(Application), 'onEarlyKernelRequest'), array(object(SessionServiceProvider), 'onEarlyKernelRequest'), array(object(RouterListener), 'onKernelRequest'), array(object(LocaleListener), 'onKernelRequest'), array(object(Application), 'onKernelRequest')), 'kernel.request', object(GetResponseEvent)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 53 at EventDispatcher-&gt;dispatch('kernel.request', object(GetResponseEvent)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 110 at HttpKernel-&gt;handleRaw(object(Request), '1') in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 73 at HttpKernel-&gt;handle(object(Request), '1', true) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/silex/silex/src/Silex/Application.php line 509 at Application-&gt;handle(object(Request)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/silex/silex/src/Silex/Application.php line 484 at Application-&gt;run() in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/web/index.php line 49 </code></pre> <p>And:</p> <pre><code>ResourceNotFoundException: in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php line 81 at UrlMatcher-&gt;match('/prevendita/hello/sadfasdf') in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php line 30 at RedirectableUrlMatcher-&gt;match('/prevendita/hello/sadfasdf') in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/silex/silex/src/Silex/LazyUrlMatcher.php line 51 at LazyUrlMatcher-&gt;match('/prevendita/hello/sadfasdf') in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 78 at RouterListener-&gt;onKernelRequest(object(GetResponseEvent)) at call_user_func(array(object(RouterListener), 'onKernelRequest'), object(GetResponseEvent)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 164 at EventDispatcher-&gt;doDispatch(array(array(object(Application), 'onEarlyKernelRequest'), array(object(SessionServiceProvider), 'onEarlyKernelRequest'), array(object(RouterListener), 'onKernelRequest'), array(object(LocaleListener), 'onKernelRequest'), array(object(Application), 'onKernelRequest')), 'kernel.request', object(GetResponseEvent)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 53 at EventDispatcher-&gt;dispatch('kernel.request', object(GetResponseEvent)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 110 at HttpKernel-&gt;handleRaw(object(Request), '1') in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 73 at HttpKernel-&gt;handle(object(Request), '1', true) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/silex/silex/src/Silex/Application.php line 509 at Application-&gt;handle(object(Request)) in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/vendor/silex/silex/src/Silex/Application.php line 484 at Application-&gt;run() in /var/www/vhosts/teatrodellamemoria.it/httpdocs/assets/modules/prevendita/web/index.php line 49 </code></pre> <p>This is the code:</p> <pre><code>&lt;?php require_once __DIR__.'/../vendor/autoload.php'; use Teatro\Models\Reservation; use Teatro\Models\ReservationsSeat; use Symfony\Component\Validator\Constraints; use Symfony\Component\Form\FormError; $app = new Silex\Application(); $app['debug'] = true; $app-&gt;register(new Silex\Provider\TwigServiceProvider(), array( 'twig.path' =&gt; __DIR__.'/../views', )); $app-&gt;register( new Silex\Provider\UrlGeneratorServiceProvider() ); $app-&gt;register( new Silex\Provider\SessionServiceProvider(), array( // 'session.storage.options' =&gt; array('name' =&gt; 'test') ) ); $app-&gt;register( new Silex\Provider\FormServiceProvider() ); $app-&gt;register( new Silex\Provider\ValidatorServiceProvider() ); $app-&gt;register(new Silex\Provider\TranslationServiceProvider(), array( 'translator.messages' =&gt; array(), )); $app-&gt;register( new Silex\Provider\SwiftmailerServiceProvider() ); $app-&gt;get('/prevendita/hello/{name}/', function ($name) use ($app) { return "Hello $name!"; })-&gt;bind('hello_name'); $app-&gt;get('/prevendita/hello', function () use ($app) { return "Hello!"; })-&gt;bind('hello'); $app-&gt;run(); </code></pre> <p>Development server is PHP 5.4 builtin webserver Production server is PHP 5.3 CentOS</p> <p>.htaccess files are basically the same. In the production env, the silex app is into a subfolder of document root let's say /prevendita so I added</p> <pre><code>RewriteRule ^prevendita /prevendita/web/index.php [L] </code></pre> <p>to redirect any request starting with /prevendita to my silex app</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload