fastadmin部署workerman 找不到指定栏目
发现运行php server.php start的时候,出现未指定栏目的错误,一篇很长的HTML代码
经查发现是fastadmin 的CMS插件开启的伪静态所致.找资料无果,于是自己分析,特此记录一下
参考一下官方的admin模块入口文件,代码如下:
define('APP_PATH', __DIR__ . '/../application/');
// 判断是否安装
if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
header("location:./install.php");
exit;
}
// 加载框架引导文件
require __DIR__ . '/../thinkphp/base.php';
// 绑定到admin模块
\think\Route::bind('admin');
// 关闭路由
\think\App::route(false);
// 设置根url
\think\Url::root('');
// 执行应用
\think\App::run()->send();
于是,我把server.php的代码修改了一下,如下:
#!/usr/bin/env php
<?php
define('APP_PATH', __DIR__ . '/application/');
// define('BIND_MODULE','index/Index');
// 加载框架引导文件
// require __DIR__ . '/thinkphp/start.php';
// 加载框架引导文件
require __DIR__ . '/thinkphp/base.php';
// 绑定到admin模块
\think\Route::bind('push/Worker');
// 关闭路由
\think\App::route(false);
// 设置根url
\think\Url::root('');
// 执行应用
\think\App::run()->send();
完工!
