phpword - 服务器上的 TemplateProcessor 错误 500 但不是本地
问题描述
我对 phpWord 和 TemplateProcessor 有疑问。我做了一个非常简单的例子:
require '../../vendor/autoload.php';
$document = new \PhpOffice\PhpWord\TemplateProcessor('test/test2.docx');
$document->setValue('test',1);
$document->saveAs('test2.docx');
header("location:test2.docx");
当我在笔记本电脑上运行它时,一切都很好,但在服务器上,什么也没有发生,我收到错误 500。
(对于 inf :我将电子表格用于 excel,并且一切正常 localhost 和 serverur。)
PhpWord version is 0.16 with composer
Php 7.3
Localhost : windows.
Serveur: linux with for the directory chmod 0755
当我做一个
echo sys_get_temp_dir() . PHP_EOL;
我得到:/tmp。
最后一件事,如果我使用
$PHPWord->loadTemplate,
在服务器上没问题,但是 loadTemplate 没有 cloneBlock 功能。
如果有人可以帮助我,那将非常友好,我已经失去了所有的头发。
蒂埃里
解决方案
推荐阅读
- python - How to fill a circle with a gradient?
- ruby-on-rails - 我正在编写 Micheal Hartls Rail Tutorial 这本书我使用了相同的代码但得到了不同的结果
- ruby-on-rails - 如何在日志记录中过滤部分路径(不是参数)?
- flutter - 如何在 Flutter Web 中的 Row 中调整 IconButton 的大小?图标大小呈现在行视图之外
- laravel - 未找到 Laravel 5.8 类“Doctrine\DBAL\Driver\PDOMySql\Driver”
- python - 我需要我的代码只接受浮点值
- mysql - 连接到同一 DBMS 上的“外部”数据库
- java - 使用 Spring Boot 解析未转义的 Json
- javascript - 使用基本身份验证获取对 localhost 的请求
- time - 简单的任务:我希望在单击“尝试”后发生的事情发生,而实际上不需要单击按钮