E
E
edik892016-09-26 12:56:57
linux
edik89, 2016-09-26 12:56:57

How to run shell script from php?

The shell script does not start when trying to run it from php with the exec("sh .hooks/gitlab-webhook-push.sh") command. This script is run from the command line. I don't see anything in the logs. The nginx php-fpm bundle is used. What could be the problem?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexey Ukolov, 2016-09-26
@alexey-m-ukolov

Considering that the path to the executable file is relative, this is most likely the issue.

R
romy4, 2016-09-26
@romy4

a. wrong path (log errors)
b. not allowed to run exec
c. anything else

D
Dmitry, 2016-09-26
@zmitrok62

shell_exec

E
edik89, 2016-09-26
@edik89

I figured it out, the script still starts, it just doesn't work as it should. I'll figure out what's wrong.

V
Victor Taran, 2016-09-27
@shambler81

Let me guess, he can't execute commands from root?
leave the folder?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question