V
V
vetaliy_net2018-03-19 17:36:31
linux
vetaliy_net, 2018-03-19 17:36:31

How to run sh file in php?

Can't run sh (bash) file with root rights via php

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Victor Taran, 2018-03-19
@vetaliy_net

php.net/manual/en/function.exec.php

L
Lander, 2018-03-19
@usdglander

So it seems like always with the help of system () it was done.

D
doriulbool, 2018-03-19
@doriulbool

echo `chmod -R 777`
The backticks force the command to be executed.

P
Pantene742, 2018-04-07
@Pantene742

There is such a practice. I write the first line in the sh script that will call the interpreter and pass it the program code directly in the same file on the next line. But for scripting on a Unix system like this, it's best to use sh itself. either Python or Ruby (Python is standard in Ubuntu for this though) ruby ​​is just as good.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question