云溪的 blog
  • Archive
  • Media
  • Search
  • Tags
  • About
Home » Tags

Php

CSV 中文解析异常

最近在做导入 csv 数据的时候出现了,未按预期导出的情况,具体情况见下图: 如图所示,商家地址部分和商家电话部分,没有正常解析。后来在PHP官网找到如下解释: 该函数对区域设置是敏感的。比如说 LANG 设为 en_US.UTF-8 的话,单字节编码的文件就会出现读取错误。 我系统语言设置的 en, 当解析 utf8 字节编码的文件,就出现了上述问题。 既然找到了是因为区域的问题,就号解决了,在导入前先设置一下区域: setlocale(LC_ALL, 'us'); 如果有疑问欢迎留言交流。 Reference fgetcsv

June 6, 2020 · 1 min · 云溪

Composer Could Not Find Config  [draft]

在执行 composer require xxx 发现始终无法执行成功 执行 composer require -vvv xxx 打印详细信息 发现报错信息如下: failed to initialize global composer composer could not find the config file 最后发现在系统里有两个 composer 配置,删除掉非安装目录下的环境变量(我这边是C:\Users\Administrator\AppData\Roaming\Composer\vendor\bin 注销电脑,重新执行 composer require -vvv xxx 安装成功

April 5, 2019 · 1 min · 云溪

编译安装php常见问题

configure: error: libxml2 not found. 详细错误如下: configure: error: libxml2 not found. Please check your libxml2 installation. make: *** No targets specified and no makefile found. Stop. make: *** No rule to make target 'install'. Stop. 解决方法: $ sudo apt-get install libxml2-dev configure: error: png.h not found. 详细错误如下: configure: error: png.h not found. make: *** No targets specified and no makefile found. Stop. make: *** No rule to make target 'install'. Stop. 解决方法: $ sudo apt-get install libpng-dev configure: error: freetype-config not found. 详细错误如下: ...

February 24, 2019 · 1 min · 云溪
« Prev 
© 2025 云溪的 blog