Lumen routing cannot access access

Source: Internet
Author: User
Tags phpinfo

I follow the routing in the documentation, but I still can't access it.
Routing

$app->get('/', function () use ($app) {    $foo = new App\Http\Controllers\ExampleController();    var_dump($foo);    return $app->version();});$app->get('/info', function (){    phpinfo();});$app->get('api', 'Api\WxController@test');$app->get('ex','  ExampleController@test');

Controller


  
   

nginx配置如下

server { listen 80; server_name open.wesai.com; root /opt/xxx/wservice/public;location / { index index.html index.php; if (!-e $request_filename) { rewrite ^/(.*) /index.php last; } } location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_connect_timeout 30; #fastcgi_send_timeout 30; fastcgi_read_timeout 30; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; }}

.htaccess文件信息如下

   Options -MultiViews  RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] 

目录结构

求解救啊

Reply content:

I follow the routing in the documentation, but I still can't access it.
Routing

$app->get('/', function () use ($app) {    $foo = new App\Http\Controllers\ExampleController();    var_dump($foo);    return $app->version();});$app->get('/info', function (){    phpinfo();});$app->get('api', 'Api\WxController@test');$app->get('ex','  ExampleController@test');

Controller


  
    

nginx配置如下

server { listen 80; server_name open.wesai.com; root /opt/xxx/wservice/public;location / { index index.html index.php; if (!-e $request_filename) { rewrite ^/(.*) /index.php last; } } location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_connect_timeout 30; #fastcgi_send_timeout 30; fastcgi_read_timeout 30; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; }}

.htaccess文件信息如下

   Options -MultiViews  RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] 

目录结构

求解救啊

Composer autoload的没加吧?

  • 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.