skip to Main Content

I have a apache server running on raspberry pi and i want to execute shell script using command through in php,

the code which is to be executed is :

"usr/bin/libreoffice --pt trial1 /var/www/html/Book1.xlsx"

how to run this command ?

2

Answers


  1. use shell_exec() built in php function here

    shell_exec("usr/bin/libreoffice --pt trial1 /var/www/html/Book1.xlsx")
    

    you can also used built in function exec() or system() here see

    Login or Signup to reply.
  2. use shell_exec() to run shell script.

    And also make sure that exec and shell_exec is enabled in PHP ini.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search