C
C
connor742016-03-03 19:24:30
Silex
connor74, 2016-03-03 19:24:30

How to start Silex?

Good evening!
I decided to play around with Silex in order to master Rest.
I made the simplest file as in the office. site

<?php

// web/index.php
require_once __DIR__.'/../vendor/autoload.php';

$app = new Silex\Application();

$app->get('/hello/{name}', function ($name) use ($app) {
    return 'Hello '.$app->escape($name);
});

$app->run();

I named it index.php and placed it in the test root folder. (LAMP installed)
call test/hello/world
Gives 404:
Not Found
The requested URL /hello/world=dfdf was not found on this server.
Tell me where to sail?
PS: I forgot to mention here and put .htaccess:
<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    #RewriteBase /path/to/app
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Misty Hedgehog, 2016-03-12
@paramtamtam

Maybe AllowOverride All is missing ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question