升级https之后,出现了很多问题。
有一个刷新按钮,点击刷新订单按钮之后会使用 ajax 对 3 个 url 同时请求 json 数据。但是服务器经常返回状态值 500 的内容,或者空文件,浏览器还一直下载这个空的 html 文件或者含有 debug 错误信息的 html 文件。
最常返回的是
PHP Notice: Constant APP_PATH already defined in /data/wwwroot/fx/public/index.php on line 15,
PHP Notice: Constant THINK_VERSION already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant THINK_START_TIME already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant THINK_START_MEM already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant EXT already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant DS already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant LIB_PATH already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant CORE_PATH already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant TRAIT_PATH already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant IS_CLI already defined in /data/wwwroot/fx/thinkphp/ba
PHP Notice: Constant IS_WIN already defined in /data/wwwroot/fx/thinkphp/ba
PHP Fatal error: Cannot redeclare class think\\Loader in /data/wwwroot/fx/thinkphp/library/think/Loader.php on line 16,
PHP Fatal error: Class 'think\\Log' not found in /data/wwwroot/fx/thinkphp/library/think/exception/Handle.php on line 55,
PHP Fatal error: Class 'think\\Hook' not found in /data/wwwroot/fx/thinkphp/library/think/Response.php on line 131
私以为,应该是服务器的原因,可能https对于瞬间多个请求不能正确处理。
本人实用的 centOS 6.8 apache 2.4.26
ThinkPHP 5.0.9
https证书使用的是 let's encrypt certbot自动部署而成。
sever-pool的配置如下
<IfModule mpm_prefork_module>
StartServers 5
ServerLimit 5500
MaxClients 5000
MaxRequestWorkers 500
MaxConnectionsPerChild 500
</IfModule>
已经搞了三天了,我的解决办法是发起 ajax 请求中间间断一段时间,使用 setTimeOut 函数来分开请求,但是这样效率太低了,不知道各位大神有没有解决办法
最佳答案