php – Libreoffice源代码未找到aws linux

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – Libreoffice源代码未找到aws linux脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我想在我的aws linux服务器上将文件从doc转换为pDF.在我以前的机器上它工作正常,但现在我的新机器出现问题.唯一的区别是我已经从 PHP 7.0升级PHP 7.2.和libre办公室版本 @H_403_1@LibreOffice 6.0.1.1 00m0(Build:1)

@H_403_1@我试过给libreoffice和执行命令但没有成功的包提供root权限.

@H_403_1@这是我使用https://github.com/szonov/libreoffice-converter的包

@H_403_1@我正在使用laravel 5.4.这是执行操作的包中的代码

$replacement = array(
        'bin'        => $this->bin,'convert_to' => $convert_to,'outdir'     => $outdir,'source'     => $this->source
    );
    $cmd = $this->;makeCommand($replacement);
    $cmd = "sudo ".$cmd;
    shell_exec($cmd);
    $result = false;
    if (file_exists($outfile)) {
        $this->mkdir(dirname($this->destination));
        $result = rename($outfile,$this->destination);
    }

    // remove temporary sub directory
    rmdir($outdir);
    return $result;
@H_403_1@我尝试追加sudo,因为当我执行命令并执行使用sudo时,它在命令行中工作.

所以你需要使用类似下面的东西 @H_403_1@Execute root commands via PHP

@H_403_1@或者应该启用登录www-data用户

sudo usermod -s /bin/bash www-data
@H_403_1@然后,您应该使用该用户登录并修复所有权限问题,以便您可以运行该命令

sudo su www-data
@H_403_1@完成此操作后,请务必使用以下内容重置登录信息

sudo usermod -s /bin/nologin www-data
@H_403_1@一旦问题在用户终端中解决,您也可以在apache中运行命令而不会出现问题

脚本宝典总结

以上是脚本宝典为你收集整理的php – Libreoffice源代码未找到aws linux全部内容,希望文章能够帮你解决php – Libreoffice源代码未找到aws linux所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。