Lumen 路由无法访问访问
程序员文章站
2022-05-28 12:02:45
...
我按照文档里的路由进行配置但是还是无法访问
路由
$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');
控制器
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]
目录结构
求解救啊
回复内容:
我按照文档里的路由进行配置但是还是无法访问
路由
$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');
控制器
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的没加吧?
推荐阅读
-
VISTA下无线连接路由器时提示“已将此计算机连接到xx(SSID),但该计算机不具备访问I
-
无线连接路由器时提示“无线连接被配置为不连接到访问点网络”的解决方法(图文)
-
linux中启动tomcat后浏览器无法访问的解决方法
-
打开文件夹提示拒绝访问、无法访问、位置不可用的解决方法
-
PHP在Windows IIS上传的图片无法访问的解决方法
-
Nginx下修改WordPress固定链接导致无法访问的问题解决
-
无法访问电脑系统提示错误库没有注册的解决方法
-
127.0.0.1无法访问,没有权限: GetObject
-
通过//计算机名无法访问局域网,能通过//ip地址可以访问的解决方法
-
IIS配置后本地访问正常,但外网无法访问