douzhang8840 2019-04-16 20:35
浏览 628

安装特定版本的mPDF

I am trying to install mPDF on my Centos server with PHP 7.0.33 and it continues to default to mPDF version 6.1. I need version 7 or 8. I tried manually uploading mPDF 8 from github but it creates a cryptographic fingerprint issue with composer.

Is there a way to force install version 8 or 7?

  • 写回答

1条回答 默认 最新

  • dongyu8694 2019-04-17 17:08
    关注

    Here's what I ultimately had to do. Since 'composer require' runs at the command line it detects the CLI version of PHP, which is different from what apache might be using. I updated my CLI PHP to 7.0 with the following script:

    https://github.com/dfuentes87/change_phpcli.sh/blob/master/change_phpcli.sh

    cd ~/

    touch change_phpcli.sh

    vim change_phpcli.sh

    (I just pasted the code in since it is a small file) save file then

    chmod +x change_phpcli.sh

    run the script ./change_phpcli.sh

    and answer the question, I entered 7.0 for my version

    Then run composer require mpdf/mpdf:^8.0

    I also had to force my code to use a specific tmp folder for mPDF for some reason using:

    require_once APPPATH . '../vendor/autoload.php';

    $mpdf = new \Mpdf\Mpdf(['tempDir' => APPPATH . '../vendor/mpdf/mpdf/tmp/']);

    and chown it to the user/group that run my web scripts:

    chown myuser:psacln vendor/mpdf/mpdf/tmp/

    Hope this helps, thanks for the pointers @Finwe

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog