Nginx+PHP写接口的时候,本地测试没问题,放到服务器上所有ajax调用接口返回的json都不识别,不走success方法,结果发现返回值的最前面多了一个红点,检查所有PHP文件发现都是utf8编码,就是不识别。查了半天发现是某些资源文件是带bom头的,
解决办法:
在服务器上查找包含BOM头的文件,命令如下:
grep -r -I -l $'^\xEF\xBB\xBF' ./
删除bom头命令:
find . -type f -exec sed -i 's/\xEF\xBB\xBF//' {} \;
参考:https://blog.csdn.net/cbbbc/article/details/49865687
https://segmentfault.com/q/1010000009008456
vue2 Implicit conversion from float int loses precision php8Implicit Mysql8新增用户,mysql8配置权限,mysql8配置,mysql8配置文件 Linux命令,scp,scp命令,Linux复制 git commit git add centos git 搭建FTP,Linux FTP,禁止FTP登录ssh 上传文件,阿里云OSS上传,文件上传到OSS,OSS文件上传,OSS上传 微信支付,微信支付V3,PHP微信支付,微信nativePay支付,微信jsapi支付 微信支付,微信支付V3,PHP微信支付 bootstrap4 modal, lavarel The subversion command line tools are no longer provided by Xcode. 银联支付,tp5.1银联支付 支付宝即时到账,PHP支付宝 system libzip must be upgraded to version >= 0.11 CMake 3.0.2 or higher is required