Monday 15 March 2010

Laravel 4 Routing (controller not found) -


Please help, I Laravel4'm using, but not because I have to make it work on my Mac at home I can have it, I have a Mac at work with either problem or I'm missing something obvious or my mac has been set aside.

The problem I am doing is that I can only get HomeController to work if I try to use the test controller I can not get the controller method found. whooops error control method not found

  redirects / test GATEWAY_INTERFACE CGI / 1.1 SERVER_PROTOCOL HTTP / 1.1 REQUEST_METHOD get QUERY_STRING REQUEST_URI / test scripts PATH_INFO / test /indexkphp PATH_TRANSLATED redirect  < / Pre> 

My routes

  Root :: Controller ('test', 'test controller');   

And my test controller

  class TestController create extends BaseController {public function getIndex () {return View :: ( 'test.index'); }}   

my htaccess

  & lt; IfModule mod_rewrite.c & gt; ! Option + FollowSymLinks RewriteCond% {REQUEST_FILENAME} -f RewriteCond% on RewriteEngine {REQUEST_FILENAME} -d RewriteRule ^ (*.) $ Index.php / $ 1 [L] & lt; / IfModule & gt;    

Div class = "post-text" itemprop = "text">

In my local development environment there was a situation like me. The Laravel 4 app deployed on my remote server was working perfectly, although I could not find it to work on my local machine. Was inaccessible and were any of my routes

The problem was in the configuration of Apache loading which did not allow <- The problem is that only applications (Home Controller / Public) was the root folder. Code>. My solution was to define the details of a new directory for my site path as follows:

  & lt; The directory "/ path / to / your / sites" & gt; Option Index Follow-up Simlinks Multivise Allow override All the necessary & lt; / Directory & gt;   

You can put it in httpd.conf or in any configuration file that is loading. If there is a definition already for that path, then you should update it accordingly. In my case I have added my httpd-vhosts.conf file to the virtual host definition above:

    

Finally your / etc / hosts

  127.0.0.1 laravel.dev   < P> In this way, you can access your local environment through this URI:   

No comments:

Post a Comment