O
O
ObehanProger2019-08-26 10:45:17
PHP
ObehanProger, 2019-08-26 10:45:17

Why isn't bash running under php?

The script.sh script is located at /home/user/script.sh:

#!/bin/bash
echo "Успешно!"

and bound to the /site/test route
<?php
  $message=shell_exec("/home/user/script.sh 2>&1");
  print_r($message);
?>

But when opening this route, it gives "/home/user/script.sh: Permission denied".
Although the owner of script.sh and the site is the same. And the rights to script.sh 777.
Where is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2019-08-26
@saboteur_kiev

Is the script executed through a php script, or through a website?
Most likely the web server does not have access to /home/user/script.sh

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question