Php framework-phpslim framework route not found

Source: Internet
Author: User
Tags autoload
{Code...} accessing localhostapi. phpindex on the local machine has output, but it is 404 notfound on Ubuntu. Why? Ps: this framework has fewer resources...
require_once "slim/vendor/autoload.php";$app = new \Slim\Slim(['debug' => true,'mode' => 'development']);$app->get("/index", function() {    echo "Hello Slim World";});$app->run();

There is output for accessing localhost/api. php/index on the local machine, but it is 404 not found on Ubuntu. Why?
Ps: this framework has fewer 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();

There is output for accessing localhost/api. php/index on the local machine, but it is 404 not found on Ubuntu. Why?
Ps: this framework has fewer resources...

The reason is found, because pseudo-static is not set

# Nginxroot/Users/jackluo/Works/php/rest; location/{root/Users/jackluo/Works/php/rest; index index.html index. php; try_files $ uri // index. php? $ Args;} # apache [1] Start mod_rewrite -- remove #, # indicates LoadModule rewrite_module modules/mod_rewrite.so [2] modifying AllowOverride None to 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
      

The slim framework is still good, and it feels quite helpful to use it. Http://dighash.com/a simple slim demo ~

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.