0

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 ?

4
  • 3
    Possible duplicate of PHP shell_exec() vs exec() Commented Sep 18, 2019 at 4:31
  • @ShanteshwarInde no its not,i know the difference ,i asked this because the shell_exec() returns null when executed and nothing happens Commented Sep 18, 2019 at 6:08
  • how we know what you have tried and what not. for this you need to specified all things read how to ask question Commented Sep 18, 2019 at 6:29
  • @ShanteshwarInde okay sorry for that , do you have any clues ? Commented Sep 18, 2019 at 13:08

2 Answers 2

3

use shell_exec() to run shell script.

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

Sign up to request clarification or add additional context in comments.

1 Comment

yes shell_exec is enabled in php.ini but nothing happening
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.