E_COMPILE_ERROR Cannot redeclare getReqIp() (previously declared in /data/www/html/lihongliang/GatewayWorker-master/Applications/mobilelive/Web/api.php:38) in /data/www/html/lihongliang/GatewayWorker-master/Applications/mobilelive/Web/api.php on line 50
worker exit with status 65280
E_COMPILE_ERROR Cannot redeclare getReqIp() (previously declared in /data/www/html/lihongliang/GatewayWorker-master/Applications/mobilelive/Web/api.php:38) in /data/www/html/lihongliang/GatewayWorker-master/Applications/mobilelive/Web/api.php on line 50
E_COMPILE_ERROR Cannot redeclare getReqIp() (previously declared in /data/www/html/lihongliang/GatewayWorker-master/Applications/mobilelive/Web/api.php:38) in /data/www/html/lihongliang/GatewayWorker-master/Applications/mobilelive/Web/api.php on line 50
worker exit with status 65280
还会报这种错但是我可以确定没有重定义
workerman是常驻内存的,和php-fpm运行机制不太一样。
require_once意思就只加载一次,由于常驻内存,那么下次再次加载config.php时就会略过,不会再次加载 该文件,文件里的数组变量自然就不会再加载。所以当前进程第二次请求的时候就会报数组没定义。
提示已经很明显,mobilelive/Web/api.php:38行定义了getReqIp,mobilelive/Web/api.php:50行又定义了一次
如果是开发web对workerman又不足够了解,强烈建议你用nginx php-fpm,开发简单方便很多。