【问题标题】:libreoffice is not executable at /usr/bin/libreofficelibreoffice 在 /usr/bin/libreoffice 中不可执行
【发布时间】:2021-08-23 17:42:56
【问题描述】:

您好,我正在使用带有 symfony 项目的 Docker,它会检查 libreoffice。我收到以下错误,响应代码为 500。

“libreoffice 在 /usr/bin/libreoffice 中不可执行”

if (!is_executable($this->libreOffice)) {
            $logger->critical(sprintf('[ReportTemplateService][error] libreoffice is not executable at %s', $this->libreOffice));
            throw new \Exception(sprintf('libreoffice is not executable at %s', $this->libreOffice));
        }
        $this->twigEngine = $twigEngine;
        $this->logger = $logger; 

谁能帮帮我。

【问题讨论】:

  • 我们需要更多信息来帮助您。文件存在吗?是否可以开始执行。你试过什么了?你想用 libreoffice 做什么?
  • 如果文件存在,试试chmod +x /usr/bin/libreOffice
  • 请分享更多细节。这与 PHP 或 Symfony 有什么关系?您尝试过什么来解决问题?

标签: php symfony


【解决方案1】:

is_executable 如果文件名存在且可执行,则返回 true,否则返回 false。

确保容器正确配置为access the file

于是开始检查/usr/bin/libreoffice是否存在,文件permissions,是否为executable。所以get into the container shell,然后运行以下命令:

ls -la /usr/bin/libreoffice

【讨论】:

  • 如果可以从容器内部访问,我该如何检查?
  • 我已经去过那里,但我认为我做错了。所以输出是 ls: cannot access '/usr/bin/libreoffice': No such file or directory。现在的问题是如何访问它?不进入 docker 我得到这个 ls -la /usr/bin/libreoffice lrwxrwxrwx 1 root root 34 Mar 15 23:42 /usr/bin/libreoffice -> ../lib/libreoffice/program/soffice
猜你喜欢
  • 1970-01-01
  • 2014-03-27
  • 1970-01-01
  • 1970-01-01
  • 2023-03-05
  • 1970-01-01
  • 1970-01-01
  • 2016-04-11
  • 1970-01-01
相关资源
最近更新 更多