I've installed Symfony2 2.7 in C:\xampp\htdocs\sym1\blog, I created a new controller manually following this Document
<?php
// src/AppBundle/Controller/LuckyController.php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class LuckyController extends Controller
{
/**
* @Route("/lucky/number")
*/
public function numberAction()
{
$number = rand(0, 100);
return new Response(
'<html><body>Lucky number: '.$number.'</body></html>'
);
}
}
but when i go to
http://localhost/sym1/blog/web/lucky/number
or
http://localhost/sym1/blog/app_dev.php/lucky/number
it just displays
Oops! An Error Occurred
The server returned a "404 Not Found".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
anyone knows what's the problem?
--update--
i'm just found comment this
#RewriteRule .? %{ENV:BASE}/app.php [L]
and then add these two lines
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app_dev.php [QSA,L]
will ok, but there is a performance bar attached at the bottom of the page.
php app/console cache:clear --env=prodevery time you want to see changes on production.