PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, March 10, 2022

[FIXED] Routing in Kohana in development

 March 10, 2022     kohana, mamp, php, routes     No comments   

Issue

I am setting up my new web application using the Kohana framework.

I am using MAMP so the app is located in the htdocs folder, with this structure:

---htdocs
 --foo
  -application

I am getting this error when viewing http://localhost:8888/foo/

Kohana_HTTP_Exception[ 404 ]: The requested URL foo was not found on this server.

In the bootstrap.php the route is the default Kohana one

Route::set('default', '(<controller>(/<action>(/<id>)))')->defaults(
array(
    'controller' => 'welcome',
    'action'     => 'index',
));

Solution

Check your application/bootstrap.php file for:

Kohana::init(array(
    'base_url'   => '/foo/',
));

This is required for Kohana to understand it's in /foo/ folder.

UPD The requested URL foo was not found on this server exception message is generated if no action_<action> method was found in Controller.

If no Route was found Unable to find a route to match the URI: exception message is genereted.

Not shure Routing works as expected, but it works ;).

So check your Controller file for apropriate action method.



Answered By - s.webbandit
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing