PHP Fatal error: Uncaught com_exception: Source:Kingsoft WPS Description:文档打开失败

PHP Fatal error: Uncaught com_exception: <b>Source:</b> Kingsoft WPS<br/><b>Description:</b> 文档打开失败。

解决方案:

设置 com 实例的 codepage 参数为 65001(UTF-8),如下代码:

复制代码
$word = new com('word.application', null, 65001) or die('Unable to instantiate Word');

// com 构造函数的参数
public com::__construct(
    string $module_name,
    array|string|null $server_name = null,
    int $codepage = CP_ACP,
    string $typelib = ""
)

更多详情:https://www.php.net/manual/en/com.construct.php

相关推荐
FungLeo31 分钟前
FengCMS · PHP+MySQL 升级实录· 依赖生命周期与来源核验:jQuery 4.0 迁移 + SHA-256 核验脚本
mysql·php·jquery·依赖管理·fengcms
kitsch0x971 小时前
MITRE Engage 中的网络欺骗
安全·web安全·php
FungLeo1 小时前
FengCMS · PHP+MySQL 升级实录 · CI 落地:PHP 8.4/8.5 矩阵、隔离凭证、诊断门槛失败
mysql·ci/cd·php·持续集成·fengcms
FungLeo21 小时前
FengCMS · PHP+MySQL 升级实录· 回归测试从 69 项到 478 项:HTTP/数据库回归套件怎么搭
数据库·mysql·php·回归测试·fengcms
FungLeo1 天前
FengCMS · PHP+MySQL 升级实录· PHP Session 锁:什么时候释放能救活并发
android·mysql·php·session·fengcms
bufengwangluo2 天前
企业上网行为管理:代理网关部署位置怎么选,策略怎么落
开发语言·php
FungLeo2 天前
FengCMS · PHP+MySQL 升级实录 · 输出转义的度:面包屑双重编码、默认转义与 cms_html()信任声明
mysql·html·php·fengcms·输出转义
FungLeo2 天前
FengCMS ·PHP+MySQL升级实录 · 富文本清洗配置实战:白名单、URI scheme、禁 iframe/id、实例缓存
mysql·缓存·php·xss·fengcms
苏琢玉2 天前
从 dsh-im 到微信:我做了个 PHP 包,让微信变成 AI 的消息入口
微信·php·composer
JaguarJack2 天前
php-wasm-builder 1.0 发布,让 PHP 应用在浏览器里运行
后端·php·服务端