PHP how to execute a command

前端 未结 4 1643
北荒
北荒 2021-01-06 13:49

I\'m trying to use LibreOffice for converting a spreadsheet to another format, when I execute the command from the console it works fine but when I do it from PHP using exec

4条回答
  •  自闭症患者
    2021-01-06 14:31

    I solved this problem with the command below :

    system('
      export HOME=/tmp 
      libreoffice --headless --invisible --norestore --convert-to pdf --outdir /my/folder /my/file/calc.xls');
    

提交回复
热议问题