TP6.0 swoole 问题

浏览:4543 发布日期:2019/05/07 分类:ThinkPHP6专区
启动swoole 报以下这些错
thrown in /home/wwwtp6/config/define.php on line 8
PHP Fatal error: Uncaught think\exception\ErrorException: Constant API_SUCCESS already defined in /home/wwwtp6/config/define.php:8
Stack trace:
#0 [internal function]: think\initializer\Error->appError(8, 'Constant API_SU...', '/home/wwwtp6/co...', 8, Array)
#1 /home/wwwtp6/config/define.php(8): define('API_SUCCESS', 1000)
#2 /home/wwwtp6/vendor/topthink/framework/src/think/Config.php(150): include('/home/wwwtp6/co...')
#3 /home/wwwtp6/vendor/topthink/framework/src/think/Config.php(127): think\Config->parse('/home/wwwtp6/co...', 'define')
#4 /home/wwwtp6/vendor/topthink/framework/src/think/App.php(427): think\Config->load('/home/wwwtp6/co...', 'define')
#5 /home/wwwtp6/vendor/topthink/framework/src/think/App.php(364): think\App->load()
#6 /home/wwwtp6/vendor/topthink/think-swoole/src/Swoole.php(180): think\App->initialize()
#7 /home/wwwtp6/vendor/topthink/think-swoole/src/Swoole.php(168): think\swoole\Swoole->prepareApplication()
#8 {main}

define.php 代码
<?php

/**
* 一些公用的常量
*/
use think\facade\Env;
//---Logic和service、api的return码--
define('API_SUCCESS', 1000); //成功
define('API_ERROR', 1001); //失败
define('API_LOCATION', 1002); //跳转
define('API_UNAUTHORIZED', 401); //未登录或者登录超时
?>

把define删了就可以正常启动,但是有这块代码就会报错
最佳答案
评论( 相关
后面还有条评论,点击查看>>