Slim aways show 404 error page

idemax's Avatar

idemax

05 Dec, 2012 11:52 AM

I've tryed place the post here, but code are getting an wrong formatting, so, I posted on Stackoverflow my doubt:

http://stackoverflow.com/questions/13715439/slim-aways-show-404-err...

  1. Support Staff 2 Posted by Brian Nesbitt on 06 Dec, 2012 02:22 PM

    Brian Nesbitt's Avatar

    Are you running the site from the web root of a virtual host?

  2. 3 Posted by idemax on 06 Dec, 2012 02:55 PM

    idemax's Avatar

    Virtual host... e.g. localhost

  3. Support Staff 4 Posted by Brian Nesbitt on 07 Dec, 2012 04:30 AM

    Brian Nesbitt's Avatar

    RE : http://docs.slimframework.com/pages/routing-url-rewriting/

    Maybe you don't have url rewriting enabled? "AllowOverride All"

  4. 5 Posted by idemax on 07 Dec, 2012 10:28 AM

    idemax's Avatar

    Yes, I enabled it to...

  5. Support Staff 6 Posted by Brian Nesbitt on 07 Dec, 2012 02:26 PM

    Brian Nesbitt's Avatar

    What url have you tried?

    Have you tried hitting the index.php directly? You should try the ugly URL versions to see if those work. If so, then you can say its a rewrite issue.

    Assuming your code from the SO post hasn't changed and that you are running the index.php file in the webroot of your virtual host.

    http://localhost/index.php
    

    You can also try a url like http://localhost/index.php/name/brian if you add a route like this:

    $app->get('/name/:name', function ($name) {
       echo "Hello $name";
    });
    
  6. 7 Posted by idemax on 08 Dec, 2012 12:36 AM

    idemax's Avatar

    Look that, now are showing this error:

    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /Users/idemax/Development/Workspaces/www/ficadeolho/index.php on line 14

    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /Users/idemax/Development/Workspaces/www/ficadeolho/index.php on line 14

    Parse error: syntax error, unexpected T_STRING in /Users/idemax/Development/Workspaces/www/ficadeolho/index.php on line 14

    My file @ 14 line:

    \Slim\Slim::registerAutoloader();

  7. Support Staff 8 Posted by Brian Nesbitt on 08 Dec, 2012 12:44 AM

    Brian Nesbitt's Avatar

    What version of PHP are you running? Maybe you are running < 5.3?

    Namespaces were introduced in PHP 5.3 and is required for Slim 2.x.

    With < 5.3 you have to use Slim 1.6.x

  8. 9 Posted by idemax on 08 Dec, 2012 12:45 AM

    idemax's Avatar

    YES man!! Thanks... I`m was a dumb! Sorry...

  9. Support Staff 10 Posted by Brian Nesbitt on 08 Dec, 2012 01:15 AM

    Brian Nesbitt's Avatar

    OMG !! lol

  10. Brian Nesbitt closed this discussion on 08 Dec, 2012 01:15 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac