PHP Framework-PHP Slim framework routing not Found

Source: Internet
Author: User
Tags autoload php framework
require_once "slim/vendor/autoload.php";$app = new \Slim\Slim(['debug' => true,'mode' => 'development']);$app->get("/index", function() {    echo "

Hello Slim World

";});$app->run();

In the native access Localhost/api.php/index has output, but on Ubuntu is incredibly 404 Not Found, this is why?
PS: This framework has less resources ...

Reply content:

require_once "slim/vendor/autoload.php";$app = new \Slim\Slim(['debug' => true,'mode' => 'development']);$app->get("/index", function() {    echo "

Hello Slim World

";});$app->run();

In the native access Localhost/api.php/index has output, but on Ubuntu is incredibly 404 Not Found, this is why?
PS: This framework has less resources ...

The reason was found because pseudo-static was not set

#nginxroot        /Users/jackluo/Works/php/rest;    location / {        root    /Users/jackluo/Works/php/rest;        index   index.html index.php;        try_files $uri $uri/ /index.php?$args;    }#apache【1】启动mod_rewrite——去掉#,#代表注释LoadModule rewrite_module modules/mod_rewrite.so【2】修改AllowOverride None为AllowOverride All## Deny access to the entirety of your server's filesystem. You must# explicitly permit access to web content directories in other # 
  
   
    
    blocks below.#
   
        AllowOverride All    Require all granted
  
       

Slim frame is still good, with very feeling. http://dighash.com/a simple slim demo~

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.